Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1fdc90fb authored by NeilBrown's avatar NeilBrown Committed by Chris Ball
Browse files

mmc: omap_hsmmc: Handle failure of regulator_get better.



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: default avatarNeilBrown <neilb@suse.de>
Acked-by: default avatarRajendra Nayak <rnayak@ti.com>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent 5fdb4505
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -301,12 +301,12 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
	struct regulator *reg;
	struct regulator *reg;
	int ocr_value = 0;
	int ocr_value = 0;


	mmc_slot(host).set_power = omap_hsmmc_set_power;

	reg = regulator_get(host->dev, "vmmc");
	reg = regulator_get(host->dev, "vmmc");
	if (IS_ERR(reg)) {
	if (IS_ERR(reg)) {
		dev_dbg(host->dev, "vmmc regulator missing\n");
		dev_dbg(host->dev, "vmmc regulator missing\n");
		return PTR_ERR(reg);
	} else {
	} else {
		mmc_slot(host).set_power = omap_hsmmc_set_power;
		host->vcc = reg;
		host->vcc = reg;
		ocr_value = mmc_regulator_get_ocrmask(reg);
		ocr_value = mmc_regulator_get_ocrmask(reg);
		if (!mmc_slot(host).ocr_mask) {
		if (!mmc_slot(host).ocr_mask) {