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

Marek Vasut marex at denx.de
Wed Aug 28 10:44:34 CEST 2013


Dear Przemyslaw Marczak,

> 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 at samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park at samsung.com>
> CC: Marek Vasut <marek.vasut at 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;
>  	}

You still use dev_num further in the code, why not convert the whole thing to 
use *mmc ?

Best regards,
Marek Vasut


More information about the U-Boot mailing list