Re: [PATCH] mmc: mvsdio: handle clk_prepare_enable() failure in probe

From: Ulf Hansson

Date: Mon Nov 30 2026 - 11:15:49 EST


On Tue, Nov 17, 2026 at 3:07 AM Luo Yifan <luoyifan@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> mvsdio_probe() ignores the return value of clk_prepare_enable() and keeps
> programming the controller, including reading the clock rate and touching
> the registers, with the clock possibly off.
>
> Return the error. The cleanup label and the remove callback already
> disable the clock, so no extra unwinding is needed before this point.
>
> Signed-off-by: Luo Yifan <luoyifan@xxxxxxxxxxxxxxxxxxxx>

Applied for next, thanks!

Kind regards
Uffe


> ---
> drivers/mmc/host/mvsdio.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
> index 7d86426c60..6870b7708d 100644
> --- a/drivers/mmc/host/mvsdio.c
> +++ b/drivers/mmc/host/mvsdio.c
> @@ -725,7 +725,9 @@ static int mvsd_probe(struct platform_device *pdev)
> if (IS_ERR(host->clk))
> return dev_err_probe(&pdev->dev, -EINVAL, "no clock associated\n");
>
> - clk_prepare_enable(host->clk);
> + ret = clk_prepare_enable(host->clk);
> + if (ret)
> + return ret;
>
> mmc->ops = &mvsd_ops;
>
> --
> 2.24.4
>
>
>