[U-Boot] [PATCH v2 4/7] mmc: rescan fails on empty slot

Andy Fleming afleming at gmail.com
Wed Aug 17 04:15:00 CEST 2011


On Mon, Jul 18, 2011 at 9:40 AM, Michael Jones
<michael.jones at matrix-vision.de> wrote:
> Fail in 'mmc rescan' if mmc_init() returns error

I think, if we're going to do this, we should change them all.

Also, for the purpose you want, it seems like we should consider
adding or modifying a command to just report whether the slot has a
card.


>
> Signed-off-by: Michael Jones <michael.jones at matrix-vision.de>
> ---
> Changes for v2:
>  - None. Resubmitting to include custodian in cc:
>
>  common/cmd_mmc.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
> index 176646d..28918f6 100644
> --- a/common/cmd_mmc.c
> +++ b/common/cmd_mmc.c
> @@ -165,9 +165,11 @@ int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
>                }
>
>                mmc->has_init = 0;
> -               mmc_init(mmc);
>
> -               return 0;
> +               if (mmc_init(mmc))
> +                       return 1;
> +               else
> +                       return 0;


Is there a reason to return 1 instead of returning whatever error
mmc_init() returns?

ie:

return mmc_init(mmc);


Andy


More information about the U-Boot mailing list