All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaehoon Chung <jh80.chung@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V2] cmd_mmc.c: check mmc_init() during mmc dev
Date: Wed, 21 May 2014 14:40:18 +0900	[thread overview]
Message-ID: <537C3C42.4080801@samsung.com> (raw)
In-Reply-To: <1400605052-14714-1-git-send-email-swarren@wwwdotorg.org>

Hi, Stephen.

i didn't apply your patch. Which repository do you use?
Well, if you want to check, can be used "if (mmc_init(mmc))".

And i'm not sure whether this code is really need or not.

Best Regards,
Jaehoon Chung

On 05/21/2014 01:57 AM, Stephen Warren wrote:
> From: Bryan Wu <cooloney@gmail.com>
> 
> mmc dev ${devnum} will return 0 as success even if there is no card
> inserted. Booting script like tegra-common-post.h will call mmc dev
> ${devnum} to check the mmc device status, it always return 0 even if
> mmc_init() fails.
> 
> Check mmc_init() return value let mmc dev command return failure
> when mmc_init() fails.
> 
> Signed-off-by: Bryan Wu <pengw@nvidia.com>
> [swarren: Always return 1 on error; hush doesn't appear to support
> arbitrary return values. Fixed compilation error due to multiple
> declaration of ret variable.]
> Tested-by: Stephen Warren <swarren@nvidia.com>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
> v2:
> * Always return 1 on error; hush doesn't appear to support
>   arbitrary return values.
> * Fixed compilation error due to multiple declaration of ret variable.
> ---
>  common/cmd_mmc.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
> index 572aa895fa1c..2e564572f74d 100644
> --- a/common/cmd_mmc.c
> +++ b/common/cmd_mmc.c
> @@ -217,7 +217,10 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
>  			return 1;
>  		}
>  
> -		mmc_init(mmc);
> +		ret = mmc_init(mmc);
> +		if (ret)
> +			return 1;
> +
>  		if (part != -1) {
>  			ret = mmc_select_hwpart(dev, part);
>  			printf("switch to partitions #%d, %s\n",
> 

  reply	other threads:[~2014-05-21  5:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-20 16:57 [U-Boot] [PATCH V2] cmd_mmc.c: check mmc_init() during mmc dev Stephen Warren
2014-05-21  5:40 ` Jaehoon Chung [this message]
2014-05-21 16:18   ` Stephen Warren
2014-05-22  1:41     ` Jaehoon Chung
2014-05-22 16:11       ` Stephen Warren
2014-05-23 18:59 ` Stephen Warren
2014-06-12 11:13   ` Pantelis Antoniou

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=537C3C42.4080801@samsung.com \
    --to=jh80.chung@samsung.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.