Skip to content

Commit

Permalink
mmc: usdhi6rol0: handle probe deferral for regulator
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
  • Loading branch information
Rabin Vincent authored and Ulf Hansson committed Aug 27, 2015
1 parent da795ec commit 7672647
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/mmc/host/usdhi6rol0.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7672647

Please sign in to comment.