projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a1e97bd
)
mmc: mxs-mmc: disable regulator on error and in the remove function
author
Christophe JAILLET
<christophe.jaillet@wanadoo.fr>
Sat, 16 Oct 2021 06:21:44 +0000
(08:21 +0200)
committer
Ulf Hansson
<ulf.hansson@linaro.org>
Tue, 19 Oct 2021 11:02:58 +0000
(13:02 +0200)
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: 4dc5a79f1350 ("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>
drivers/mmc/host/mxs-mmc.c
patch
|
blob
|
history
diff --git
a/drivers/mmc/host/mxs-mmc.c
b/drivers/mmc/host/mxs-mmc.c
index 947581de786014c041af96c38637654766e79e00..8c3655d3be961a4e45efaa8316cbfcc8aa93db1c 100644
(file)
--- a/
drivers/mmc/host/mxs-mmc.c
+++ b/
drivers/mmc/host/mxs-mmc.c
@@
-552,6
+552,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)
{
struct device_node *np = pdev->dev.of_node;
@@
-591,6
+596,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);