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

Commit f2ddc1da authored by Balaji T K's avatar Balaji T K Committed by Chris Ball
Browse files

mmc: omap_hsmmc: use devm_regulator API



Use devm_regulator API, while at it use
devm_regulator_get_optional for optional vmmc_aux supply

Signed-off-by: default avatarBalaji T K <balajitk@ti.com>
Acked-by: default avatarTony Lindgren <tony@atomide.com>
Tested-by: default avatarFlorian Vaussard <florian.vaussard@epfl.ch>
Tested-by: default avatarStefan Roese <sr@denx.de>
Signed-off-by: default avatarChris Ball <chris@printf.net>
parent c9ae64db
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -321,7 +321,7 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
	struct regulator *reg;
	int ocr_value = 0;

	reg = regulator_get(host->dev, "vmmc");
	reg = devm_regulator_get(host->dev, "vmmc");
	if (IS_ERR(reg)) {
		dev_err(host->dev, "vmmc regulator missing\n");
		return PTR_ERR(reg);
@@ -341,7 +341,7 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
		}

		/* Allow an aux regulator */
		reg = regulator_get(host->dev, "vmmc_aux");
		reg = devm_regulator_get_optional(host->dev, "vmmc_aux");
		host->vcc_aux = IS_ERR(reg) ? NULL : reg;

		/* For eMMC do not power off when not in sleep state */
@@ -371,8 +371,6 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)

static void omap_hsmmc_reg_put(struct omap_hsmmc_host *host)
{
	regulator_put(host->vcc);
	regulator_put(host->vcc_aux);
	mmc_slot(host).set_power = NULL;
}