All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] counter: rz-mtu3-cnt: check clk_prepare_enable() return value
@ 2026-08-28  7:11 Li Youhong
  2026-08-28  9:24 ` Vidhu Sarwal
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Li Youhong @ 2026-08-28  7:11 UTC (permalink / raw)
  To: biju.das.jz, wbg; +Cc: linux-iio, linux-renesas-soc, Li Youhong

From: Li Youhong <liyouhong@kylinos.cn>

The driver ignored clk_prepare_enable() failures during probe and
runtime resume.  Propagate the error so probe does not continue with
the clock disabled and resume does not report success falsely.

Signed-off-by: Li Youhong <liyouhong@kylinos.cn>
---
 drivers/counter/rz-mtu3-cnt.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/counter/rz-mtu3-cnt.c b/drivers/counter/rz-mtu3-cnt.c
index 7bfb6979193c..6f746cf598c0 100644
--- a/drivers/counter/rz-mtu3-cnt.c
+++ b/drivers/counter/rz-mtu3-cnt.c
@@ -817,9 +817,7 @@ static int rz_mtu3_cnt_pm_runtime_resume(struct device *dev)
 {
 	struct clk *const clk = dev_get_drvdata(dev);
 
-	clk_prepare_enable(clk);
-
-	return 0;
+	return clk_prepare_enable(clk);
 }
 
 static DEFINE_RUNTIME_DEV_PM_OPS(rz_mtu3_cnt_pm_ops,
@@ -861,7 +859,10 @@ static int rz_mtu3_cnt_probe(struct platform_device *pdev)
 
 	mutex_init(&priv->lock);
 	platform_set_drvdata(pdev, priv->clk);
-	clk_prepare_enable(priv->clk);
+	ret = clk_prepare_enable(priv->clk);
+	if (ret)
+		return ret;
+
 	pm_runtime_set_active(&pdev->dev);
 	pm_runtime_enable(&pdev->dev);
 	ret = devm_add_action_or_reset(&pdev->dev, rz_mtu3_cnt_pm_disable, dev);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-08-28  9:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-28  7:11 [PATCH] counter: rz-mtu3-cnt: check clk_prepare_enable() return value Li Youhong
2026-08-28  9:24 ` Vidhu Sarwal
2026-08-28  9:32   ` 李佑鸿 
2026-08-28  9:35 ` Joshua Crofts
2026-08-28  9:39 ` Biju Das
2026-08-28  9:43   ` Biju Das

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.