public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] mmc: usdhi6rol0: handle probe deferral for regulator
@ 2015-08-19 13:41 Rabin Vincent
  2015-08-19 13:41 ` [PATCH 2/3] mmc: usdhi6rol0: fix NULL pointer deref in debug print Rabin Vincent
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Rabin Vincent @ 2015-08-19 13:41 UTC (permalink / raw)
  To: ulf.hansson; +Cc: g.liakhovetski, linux-mmc, Rabin Vincent

We ignore errors from mmc_regulator_get_supply() because the usage of
the regulators is optional for the driver, but we still need to check
for and handle EPROBE_DEFER, like it's done in for example dw_mmc.
Otherwise we might end up not using the specified regulators just
because of probe order.

Signed-off-by: Rabin Vincent <rabin.vincent@axis.com>
---
 drivers/mmc/host/usdhi6rol0.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/usdhi6rol0.c b/drivers/mmc/host/usdhi6rol0.c
index 54b082b..63d5d72 100644
--- a/drivers/mmc/host/usdhi6rol0.c
+++ b/drivers/mmc/host/usdhi6rol0.c
@@ -1715,12 +1715,14 @@ static int usdhi6_probe(struct platform_device *pdev)
 	if (!mmc)
 		return -ENOMEM;
 
+	ret = mmc_regulator_get_supply(mmc);
+	if (ret == -EPROBE_DEFER)
+		goto e_free_mmc;
+
 	ret = mmc_of_parse(mmc);
 	if (ret < 0)
 		goto e_free_mmc;
 
-	mmc_regulator_get_supply(mmc);
-
 	host		= mmc_priv(mmc);
 	host->mmc	= mmc;
 	host->wait	= USDHI6_WAIT_FOR_REQUEST;
-- 
1.7.10.4


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

end of thread, other threads:[~2015-08-25 12:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-19 13:41 [PATCH 1/3] mmc: usdhi6rol0: handle probe deferral for regulator Rabin Vincent
2015-08-19 13:41 ` [PATCH 2/3] mmc: usdhi6rol0: fix NULL pointer deref in debug print Rabin Vincent
2015-08-25 12:07   ` Ulf Hansson
2015-08-19 13:41 ` [PATCH 3/3] mmc: usdhi6rol0: fix ack register write Rabin Vincent
2015-08-25 12:07   ` Ulf Hansson
2015-08-25 12:07 ` [PATCH 1/3] mmc: usdhi6rol0: handle probe deferral for regulator Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox