linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MMC/omap_hsmmc: handle failure of regulator_get better.
@ 2012-07-30  0:12 NeilBrown
  2012-07-30  5:20 ` Rajendra Nayak
  2012-08-08  4:07 ` Chris Ball
  0 siblings, 2 replies; 6+ messages in thread
From: NeilBrown @ 2012-07-30  0:12 UTC (permalink / raw)
  To: Chris Ball, Venkatraman S, Balaji T K, Rajendra Nayak
  Cc: linux-omap, linux-mmc, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1004 bytes --]


1/ if regulator_get fails, return an error.  This is important
   if it failed with EPROBE_DEFER, as the probe needs to be
   deferred.

2/ Don't set .set_power until the regulator has been found, or
   the deferred probe will not bother calling omap_hsmmc_reg_get().

Signed-off-by: NeilBrown <neilb@suse.de>

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 389a3ee..f052c29 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -299,12 +299,12 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
 	struct regulator *reg;
 	int ocr_value = 0;
 
-	mmc_slot(host).set_power = omap_hsmmc_set_power;
-
 	reg = regulator_get(host->dev, "vmmc");
 	if (IS_ERR(reg)) {
 		dev_dbg(host->dev, "vmmc regulator missing\n");
+		return PTR_ERR(reg);
 	} else {
+		mmc_slot(host).set_power = omap_hsmmc_set_power;
 		host->vcc = reg;
 		ocr_value = mmc_regulator_get_ocrmask(reg);
 		if (!mmc_slot(host).ocr_mask) {

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-08-08  4:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-30  0:12 [PATCH] MMC/omap_hsmmc: handle failure of regulator_get better NeilBrown
2012-07-30  5:20 ` Rajendra Nayak
2012-07-30  6:24   ` NeilBrown
2012-07-30  6:37     ` Rajendra Nayak
2012-07-30  6:48       ` NeilBrown
2012-08-08  4:07 ` Chris Ball

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).