[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAPDyKFo-ahKB8naaBFBdrCy3f_a08s_2e9FnjwOqsDc1-gWYvg@mail.gmail.com>
Date: Tue, 19 Oct 2021 13:36:54 +0200
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Sascha Hauer <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
dl-linux-imx <linux-imx@....com>, Chris Ball <cjb@...top.org>,
linux-mmc <linux-mmc@...r.kernel.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] mmc: mxs-mmc: disable regulator on error and in the
remove function
On Sat, 16 Oct 2021 at 08:21, Christophe JAILLET
<christophe.jaillet@...adoo.fr> wrote:
>
> 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@...adoo.fr>
Applied for next, thanks!
Kind regards
Uffe
> ---
> drivers/mmc/host/mxs-mmc.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
> index 947581de7860..8c3655d3be96 100644
> --- 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);
> --
> 2.30.2
>
Powered by blists - more mailing lists