summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorPrzemyslaw Marczak <p.marczak@samsung.com>2013-10-23 14:30:43 +0200
committerMarek Vasut <marex@denx.de>2013-11-08 20:46:19 +0100
commitf4dacf7b95e9f7d4246db00facdbe366b5c30a5a (patch)
tree4e59decec693120ac20762b5d77ef789bd756f62 /common
parent93c813b3ac4b23df891992f93252c59231dec388 (diff)
downloadu-boot-imx-f4dacf7b95e9f7d4246db00facdbe366b5c30a5a.zip
u-boot-imx-f4dacf7b95e9f7d4246db00facdbe366b5c30a5a.tar.gz
u-boot-imx-f4dacf7b95e9f7d4246db00facdbe366b5c30a5a.tar.bz2
usb: ums: allows using every mmc device with ums.
Before this change ums command only allowed use of mmc 0. Now this argument can be set. Changes: - remove mmc device number checking because it is always positive number - remove printing "no such device" - it is done by find_mmc_device() Change-Id: I767e45151ad515c7bef19e6c13087374f5e23c11 Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Cc: Marek Vasut <marex@denx.de>
Diffstat (limited to 'common')
-rw-r--r--common/cmd_usb_mass_storage.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/common/cmd_usb_mass_storage.c b/common/cmd_usb_mass_storage.c
index f6ceba7..4d3bbd8 100644
--- a/common/cmd_usb_mass_storage.c
+++ b/common/cmd_usb_mass_storage.c
@@ -20,10 +20,11 @@ int do_usb_mass_storage(cmd_tbl_t *cmdtp, int flag,
const char *usb_controller = argv[1];
const char *mmc_devstring = argv[2];
- unsigned int dev_num = (unsigned int)(simple_strtoul(mmc_devstring,
- NULL, 0));
- if (dev_num)
- return CMD_RET_USAGE;
+ unsigned int dev_num = simple_strtoul(mmc_devstring, NULL, 0);
+
+ struct ums *ums = ums_init(dev_num);
+ if (!ums)
+ return CMD_RET_FAILURE;
unsigned int controller_index = (unsigned int)(simple_strtoul(
usb_controller, NULL, 0));
@@ -32,12 +33,6 @@ int do_usb_mass_storage(cmd_tbl_t *cmdtp, int flag,
return CMD_RET_FAILURE;
}
- struct ums *ums = ums_init(dev_num);
- if (!ums) {
- printf("MMC: %u no such device\n", dev_num);
- return CMD_RET_FAILURE;
- }
-
int rc = fsg_init(ums);
if (rc) {
error("fsg_init failed");