diff mbox

[U-Boot] mmc: fix the output format

Message ID 1468923268-5931-1-git-send-email-xzy.xu@rock-chips.com
State Accepted
Commit 1bd4f92cdbc5f120c962611dfaf11ed01829d7cb
Headers show

Commit Message

Xu Ziyuan July 19, 2016, 10:14 a.m. UTC
It's nicer to see this:

=> mmc list
dwmmc@ff0c0000: 0
dwmmc@ff0f0000: 1 (eMMC)

than this:

=> mmc list
dwmmc@ff0c0000: 0dwmmc@ff0f0000: 1 (eMMC)

With the latter, it's much clearer which mmc devices are on.

Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
---

 drivers/mmc/mmc-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jaehoon Chung July 19, 2016, 10:35 a.m. UTC | #1
Hi Ziyuan,

On 07/19/2016 07:14 PM, Ziyuan Xu wrote:
> It's nicer to see this:
> 
> => mmc list
> dwmmc@ff0c0000: 0
> dwmmc@ff0f0000: 1 (eMMC)
> 
> than this:
> 
> => mmc list
> dwmmc@ff0c0000: 0dwmmc@ff0f0000: 1 (eMMC)
> 
> With the latter, it's much clearer which mmc devices are on.

You're right. After applied your patch, it may display like mmc-legacy type.
If add the comment in more detail, 
How about "Display mmc list information like mmc-legacy type." ? :)

Best Regards,
Jaehoon Chung

> 
> Signed-off-by: Ziyuan Xu <xzy.xu@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..beebc70 100644
> --- a/drivers/mmc/mmc-uclass.c
> +++ b/drivers/mmc/mmc-uclass.c
> @@ -169,7 +169,7 @@ void print_mmc_devices(char separator)
>  
>  	for (uclass_first_device(UCLASS_MMC, &dev);
>  	     dev;
> -	     uclass_next_device(&dev)) {
> +	     uclass_next_device(&dev), first = false) {
>  		struct mmc *m = mmc_get_mmc_dev(dev);
>  
>  		if (!first) {
>
Xu Ziyuan July 19, 2016, 1:56 p.m. UTC | #2
Hi Jaehoon,

On 2016年07月19日 18:35, Jaehoon Chung wrote:
> Hi Ziyuan,
>
> On 07/19/2016 07:14 PM, Ziyuan Xu wrote:
>> It's nicer to see this:
>>
>> => mmc list
>> dwmmc@ff0c0000: 0
>> dwmmc@ff0f0000: 1 (eMMC)
>>
>> than this:
>>
>> => mmc list
>> dwmmc@ff0c0000: 0dwmmc@ff0f0000: 1 (eMMC)
>>
>> With the latter, it's much clearer which mmc devices are on.
> You're right. After applied your patch, it may display like mmc-legacy type.
> If add the comment in more detail,
> How about "Display mmc list information like mmc-legacy type." ? :)
Looks good for me.I will change commit to
mmc: display mmc list informaton like mmc_legacy type.
Thanks!

>
> Best Regards,
> Jaehoon Chung
>
>> Signed-off-by: Ziyuan Xu <xzy.xu@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..beebc70 100644
>> --- a/drivers/mmc/mmc-uclass.c
>> +++ b/drivers/mmc/mmc-uclass.c
>> @@ -169,7 +169,7 @@ void print_mmc_devices(char separator)
>>   
>>   	for (uclass_first_device(UCLASS_MMC, &dev);
>>   	     dev;
>> -	     uclass_next_device(&dev)) {
>> +	     uclass_next_device(&dev), first = false) {
>>   		struct mmc *m = mmc_get_mmc_dev(dev);
>>   
>>   		if (!first) {
>>
>
>
>
diff mbox

Patch

diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c
index 38ced41..beebc70 100644
--- a/drivers/mmc/mmc-uclass.c
+++ b/drivers/mmc/mmc-uclass.c
@@ -169,7 +169,7 @@  void print_mmc_devices(char separator)
 
 	for (uclass_first_device(UCLASS_MMC, &dev);
 	     dev;
-	     uclass_next_device(&dev)) {
+	     uclass_next_device(&dev), first = false) {
 		struct mmc *m = mmc_get_mmc_dev(dev);
 
 		if (!first) {