From: Kever Yang <kever.yang@rock-chips.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] mmc-uclass: correct the device number
Date: Tue, 19 Jul 2016 17:19:30 +0800 [thread overview]
Message-ID: <578DF0A2.60700@rock-chips.com> (raw)
In-Reply-To: <CAPnjgZ2O1vSGyFKBfkC_e-8F18scGPCd4kGaJ_-3h74kBpF9TA@mail.gmail.com>
Hi Simon,
On 07/18/2016 07:55 PM, Simon Glass wrote:
> Hi Kever,
>
> On 18 July 2016 at 03:52, Kever Yang <kever.yang@rock-chips.com> wrote:
>> The devnum in is start from 0, so the device number should be
>> (devnum+1).
>>
>> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
>> ---
>>
>> drivers/mmc/mmc-uclass.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c
>> index 38ced41..7c40d24 100644
>> --- a/drivers/mmc/mmc-uclass.c
>> +++ b/drivers/mmc/mmc-uclass.c
>> @@ -111,7 +111,7 @@ struct mmc *find_mmc_device(int dev_num)
>>
>> int get_mmc_num(void)
>> {
>> - return max(blk_find_max_devnum(IF_TYPE_MMC), 0);
>> + return max((blk_find_max_devnum(IF_TYPE_MMC)+1), 0);
> Please add spaces around the +
>
> Also can you add a comment to the function in mmc.h describing what it
> should do? From what you are saying it should return the number of mmc
> devices.
>
> Also you will need to adjust mmc_get_next_devnum() which uses this function.
>
Sure, checkpatch script did not give me an error report for the format :(
For mmc_get_next_devnum(), not like legacy mmc, no one use it in mmc-uclass,
are we still need this function? blk_find_max_devnum() is used in
blk_create_device.
Thanks,
- Kever
>> }
>>
>> int mmc_get_next_devnum(void)
>> --
>> 1.9.1
>>
>>
> Regards,
> Simon
>
>
>
prev parent reply other threads:[~2016-07-19 9:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-18 9:52 [U-Boot] [PATCH] mmc-uclass: correct the device number Kever Yang
2016-07-18 11:55 ` Simon Glass
2016-07-19 9:19 ` Kever Yang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=578DF0A2.60700@rock-chips.com \
--to=kever.yang@rock-chips.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox