[PATCH] mmc: mvsdio: handle clk_prepare_enable() failure in probe
From: Luo Yifan
Date: Mon Nov 16 2026 - 21:07:34 EST
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>
---
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