mmc: mxs-mmc: disable regulator on error and in the remove function
[ Upstream commitce5f6c2c9b] The 'reg_vmmc' regulator is enabled in the probe. It is never disabled. Neither in the error handling path of the probe nor in the remove function. Register a devm_action to disable it when needed. Fixes:4dc5a79f13("mmc: mxs-mmc: enable regulator for mmc slot") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/4aadb3c97835f7b80f00819c3d549e6130384e67.1634365151.git.christophe.jaillet@wanadoo.fr Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
7c1c7ac9d1
commit
25c032c585
1 changed files with 10 additions and 0 deletions
|
|
@ -565,6 +565,11 @@ static const struct of_device_id mxs_mmc_dt_ids[] = {
|
|||
};
|
||||
MODULE_DEVICE_TABLE(of, mxs_mmc_dt_ids);
|
||||
|
||||
static void mxs_mmc_regulator_disable(void *regulator)
|
||||
{
|
||||
regulator_disable(regulator);
|
||||
}
|
||||
|
||||
static int mxs_mmc_probe(struct platform_device *pdev)
|
||||
{
|
||||
const struct of_device_id *of_id =
|
||||
|
|
@ -606,6 +611,11 @@ static int mxs_mmc_probe(struct platform_device *pdev)
|
|||
"Failed to enable vmmc regulator: %d\n", ret);
|
||||
goto out_mmc_free;
|
||||
}
|
||||
|
||||
ret = devm_add_action_or_reset(&pdev->dev, mxs_mmc_regulator_disable,
|
||||
reg_vmmc);
|
||||
if (ret)
|
||||
goto out_mmc_free;
|
||||
}
|
||||
|
||||
ssp->clk = devm_clk_get(&pdev->dev, NULL);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue