[U-Boot] [PATCH 3/3] ums: Extend ums to use all mmc devices.

Przemyslaw Marczak
2013-08-20T10:53:12Z

This change allows using every mmc device instance with ums,
like eMMC or SD cards.

Example: ums <device_number> for mmc devices.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Marek Vasut <marek.vasut@gmail.com>
---
common/cmd_usb_mass_storage.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/common/cmd_usb_mass_storage.c b/common/cmd_usb_mass_storage.c
index 33a4715..4181d3a 100644
--- a/common/cmd_usb_mass_storage.c
+++ b/common/cmd_usb_mass_storage.c
@@ -14,6 +14,7 @@
int do_usb_mass_storage(cmd_tbl_t *cmdtp, int flag,
int argc, char * const argv[])
{
+ struct mmc *mmc = NULL;
char *ep;
unsigned int dev_num = 0, offset = 0, part_size = 0;
int rc;
@@ -28,8 +29,10 @@ int do_usb_mass_storage(cmd_tbl_t *cmdtp, int flag,

dev_num = (int)simple_strtoul(argv[1], &ep, 16);

- if (dev_num) {
- puts("\nSet eMMC device to 0! - e.g. ums 0\n");
+ mmc = find_mmc_device(dev_num);
+
+ if (!mmc) {
+ printf("\neMMC device: %d not found! Try ums 0.\n", dev_num);
goto fail;
}

--
1.7.9.5