[U-Boot] [PATCH] ums: Add "dev num" parameter. Check mmc device before do ums init.

Marek Vasut marex at denx.de
Wed Sep 4 14:34:10 CEST 2013


Dear Przemyslaw Marczak,

> Hello Marek,
> Thank you for reply.
> 
> On 09/04/2013 12:26 AM, Marek Vasut wrote:
> > Dear Przemyslaw Marczak,
> > 
> >> This change allows using every mmc device instance with ums, like eMMC
> >> or SD cards. Now MMC device is checked before ums is inited.
> >> 
> >> Example of use: 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>
> >> ---
> >> 
> >>   board/samsung/trats/trats.c   |   12 +++---------
> >>   common/cmd_usb_mass_storage.c |   30 ++++++++++++++----------------
> >>   include/usb_mass_storage.h    |    4 ++--
> >>   3 files changed, 19 insertions(+), 27 deletions(-)
> >> 
> >> diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c
> >> index 7f61d17..b7f7b05 100644
> >> --- a/board/samsung/trats/trats.c
> >> +++ b/board/samsung/trats/trats.c
> >> @@ -816,17 +816,11 @@ static struct ums_board_info ums_board = {
> >> 
> >>   	},
> >>   
> >>   };
> >> 
> >> -struct ums_board_info *board_ums_init(unsigned int dev_num, unsigned
> >> int offset, -				      unsigned int part_size)
> >> +struct ums_board_info *board_ums_init(struct mmc *mmc, unsigned int
> >> offset, +					unsigned int part_size)
> >> 
> >>   {
> >> 
> >> -	struct mmc *mmc;
> >> -
> >> -	mmc = find_mmc_device(dev_num);
> >> -	if (!mmc)
> >> -		return NULL;
> >> -
> >> 
> >>   	ums_board.ums_dev.mmc = mmc;
> >> 
> >> -	ums_board.ums_dev.dev_num = dev_num;
> >> +	ums_board.ums_dev.dev_num = mmc->block_dev.dev;
> > 
> > You already pass "mmc", why pass mmc->block_dev.dev too? Is it not a
> > little redundant?
> 
> You are right, it is little redundant but pointer to this structure is
> returned so we expect that structure fields were proper filled, right?

Why not just remove the dev_num field ? The UMS core can retrieve that 
information itself.

[...]

Best regards,
Marek Vasut


More information about the U-Boot mailing list