[U-Boot] [PATCH V2 3/8] ums: remove error-checking of MMC device size

Stephen Warren swarren at wwwdotorg.org
Mon May 5 18:40:13 CEST 2014


From: Stephen Warren <swarren at nvidia.com>

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 <l.majewski at samsung.com>
Signed-off-by: Stephen Warren <swarren at nvidia.com>
Acked-by: Przemyslaw Marczak <p.marczak at samsung.com>
---
 board/samsung/common/ums.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/board/samsung/common/ums.c b/board/samsung/common/ums.c
index 1f7dda43629b..42a49018f584 100644
--- a/board/samsung/common/ums.c
+++ b/board/samsung/common/ums.c
@@ -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);
-- 
1.8.1.5



More information about the U-Boot mailing list