public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] mmc_get_dev: Return error if mmc_init fails
Date: Fri, 10 Aug 2012 20:59:12 +0200 (CEST)	[thread overview]
Message-ID: <1098314323.2282034.1344625152983.JavaMail.root@advansee.com> (raw)

Signed-off-by: Beno?t Th?baudeau <benoit.thebaudeau@advansee.com>
Cc: Andy Fleming <afleming@gmail.com>
---
 .../drivers/mmc/mmc.c                              |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git u-boot-4d3c95f.orig/drivers/mmc/mmc.c u-boot-4d3c95f/drivers/mmc/mmc.c
index c1c2862..c0b969c 100644
--- u-boot-4d3c95f.orig/drivers/mmc/mmc.c
+++ u-boot-4d3c95f/drivers/mmc/mmc.c
@@ -1311,10 +1311,9 @@ int mmc_register(struct mmc *mmc)
 block_dev_desc_t *mmc_get_dev(int dev)
 {
 	struct mmc *mmc = find_mmc_device(dev);
-	if (!mmc)
+	if (!mmc || mmc_init(mmc))
 		return NULL;
 
-	mmc_init(mmc);
 	return &mmc->block_dev;
 }
 #endif

                 reply	other threads:[~2012-08-10 18:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1098314323.2282034.1344625152983.JavaMail.root@advansee.com \
    --to=benoit.thebaudeau@advansee.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