]> Git Repo - J-u-boot.git/commitdiff
ums: remove error-checking of MMC device size
authorStephen Warren <[email protected]>
Mon, 5 May 2014 16:40:13 +0000 (10:40 -0600)
committerLukasz Majewski <[email protected]>
Thu, 8 May 2014 08:38:29 +0000 (10:38 +0200)
There's no reason to believe that an MMC device will incorrectly report
its capacity. Remove error checking of this value from ums_disk_init()
to simplify it.

Cc: Lukasz Majewski <[email protected]>
Signed-off-by: Stephen Warren <[email protected]>
Acked-by: Przemyslaw Marczak <[email protected]>
board/samsung/common/ums.c

index 1f7dda43629b0bf2b948c163fb469ad2ccbae695..42a49018f58498faaf9c747add3c6234412a92a4 100644 (file)
@@ -38,16 +38,9 @@ static struct ums ums_dev = {
 
 static struct ums *ums_disk_init(struct mmc *mmc)
 {
-       uint64_t mmc_end_sector = mmc->capacity / SECTOR_SIZE;
-
-       if (!mmc_end_sector) {
-               error("MMC capacity is not valid");
-               return NULL;
-       }
-
        ums_dev.block_dev = &mmc->block_dev;
        ums_dev.start_sector = 0;
-       ums_dev.num_sectors = mmc_end_sector;
+       ums_dev.num_sectors = mmc->capacity / SECTOR_SIZE;
 
        printf("UMS: disk start sector: %#x, count: %#x\n",
               ums_dev.start_sector, ums_dev.num_sectors);
This page took 0.035203 seconds and 4 git commands to generate.