]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
ums: remove UMS_{NUM,START}_SECTORS + UMS_START_SECTOR
authorStephen Warren <swarren@nvidia.com>
Mon, 5 May 2014 16:40:12 +0000 (10:40 -0600)
committerLukasz Majewski <l.majewski@samsung.com>
Thu, 8 May 2014 08:38:29 +0000 (10:38 +0200)
These values aren't set anywhere at present, and hence have no effect.
The concept of a single global offset/number of sectors to expose through
USB Mass Storage doesn't even make sense in the face of multiple storage
devices. Remove these defines to simplify the code.

Cc: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>
board/samsung/common/ums.c
include/usb_mass_storage.h

index ffe63685835c21061c8eb7e9b98ace37c727c295..1f7dda43629b0bf2b948c163fb469ad2ccbae695 100644 (file)
@@ -39,7 +39,6 @@ static struct ums ums_dev = {
 static struct ums *ums_disk_init(struct mmc *mmc)
 {
        uint64_t mmc_end_sector = mmc->capacity / SECTOR_SIZE;
-       uint64_t ums_end_sector = UMS_NUM_SECTORS + UMS_START_SECTOR;
 
        if (!mmc_end_sector) {
                error("MMC capacity is not valid");
@@ -47,17 +46,8 @@ static struct ums *ums_disk_init(struct mmc *mmc)
        }
 
        ums_dev.block_dev = &mmc->block_dev;
-
-       if (ums_end_sector <= mmc_end_sector) {
-               ums_dev.start_sector = UMS_START_SECTOR;
-               if (UMS_NUM_SECTORS)
-                       ums_dev.num_sectors = UMS_NUM_SECTORS;
-               else
-                       ums_dev.num_sectors = mmc_end_sector - UMS_START_SECTOR;
-       } else {
-               ums_dev.num_sectors = mmc_end_sector;
-               puts("UMS: defined bad disk parameters. Using default.\n");
-       }
+       ums_dev.start_sector = 0;
+       ums_dev.num_sectors = mmc_end_sector;
 
        printf("UMS: disk start sector: %#x, count: %#x\n",
               ums_dev.start_sector, ums_dev.num_sectors);
index e3eb1ebb2e47bf47d6b00188508cc424a8b2c181..2b959ec057e49b75b1ed7b43a5a5f9f37b569f06 100644 (file)
 #include <part.h>
 #include <linux/usb/composite.h>
 
-#ifndef UMS_START_SECTOR
-#define UMS_START_SECTOR       0
-#endif
-
-#ifndef UMS_NUM_SECTORS
-#define UMS_NUM_SECTORS                0
-#endif
-
 /* Wait at maximum 60 seconds for cable connection */
 #define UMS_CABLE_READY_TIMEOUT        60