Skip to content

Commit

Permalink
mmc: omap_hsmmc: Handle failure of regulator_get better.
Browse files Browse the repository at this point in the history
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>
Acked-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
  • Loading branch information
NeilBrown authored and Chris Ball committed Sep 4, 2012
1 parent 5fdb450 commit 1fdc90f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mmc/host/omap_hsmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,12 +301,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) {
Expand Down

0 comments on commit 1fdc90f

Please sign in to comment.