From 8c6004568f7f0cb98c35fb86a193b502278f650f Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Mon, 5 May 2014 10:40:18 -0600 Subject: [PATCH] ums: allow the user to specify the device type Allow an optional devtype parameter to the ums command, which specifies the type of the device to be exported. This could allow exporting a SATA or even another USB device. Cc: Lukasz Majewski Signed-off-by: Stephen Warren Acked-by: Przemyslaw Marczak --- common/cmd_usb_mass_storage.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/common/cmd_usb_mass_storage.c b/common/cmd_usb_mass_storage.c index 5e0211683c..2c879ea083 100644 --- a/common/cmd_usb_mass_storage.c +++ b/common/cmd_usb_mass_storage.c @@ -77,8 +77,13 @@ int do_usb_mass_storage(cmd_tbl_t *cmdtp, int flag, return CMD_RET_USAGE; usb_controller = argv[1]; - devtype = "mmc"; - devnum = argv[2]; + if (argc >= 4) { + devtype = argv[2]; + devnum = argv[3]; + } else { + devtype = "mmc"; + devnum = argv[2]; + } ums = ums_init(devtype, devnum); if (!ums) @@ -152,7 +157,8 @@ exit: return CMD_RET_SUCCESS; } -U_BOOT_CMD(ums, CONFIG_SYS_MAXARGS, 1, do_usb_mass_storage, +U_BOOT_CMD(ums, 4, 1, do_usb_mass_storage, "Use the UMS [User Mass Storage]", - "ums e.g. ums 0 0" + "ums [] e.g. ums 0 mmc 0\n" + " devtype defaults to mmc" ); -- 2.30.2