All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: devres: make clock cleanup explicit on failure
@ 2026-09-04  7:50 Onur Özkan
  2026-09-04  8:01 ` sashiko-bot
  0 siblings, 1 reply; 3+ messages in thread
From: Onur Özkan @ 2026-09-04  7:50 UTC (permalink / raw)
  To: linux-clk, linux-kernel; +Cc: mturquette, sboyd, bmasney, Onur Özkan

Use devm_add_action() and explicitly disable and unprepare the clock if
registering the action fails to avoid smatch warning.

Link: https://lore.kernel.org/all/apmUPdYtdIM0dQbF@redhat.com
Closes: https://lore.kernel.org/r/202608090025.dwxdfqFr-lkp@intel.com
Signed-off-by: Onur Özkan <work@onurozkan.dev>
---
 drivers/clk/clk-devres.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/clk-devres.c b/drivers/clk/clk-devres.c
index 4cc3863bd7da..9ed9a7b7b23f 100644
--- a/drivers/clk/clk-devres.c
+++ b/drivers/clk/clk-devres.c
@@ -123,9 +123,11 @@ struct clk *devm_clk_get_optional_enabled_with_rate(struct device *dev,
 	if (ret)
 		goto out_put_clk;
 
-	ret = devm_add_action_or_reset(dev, devm_clk_disable_unprepare, clk);
-	if (ret)
+	ret = devm_add_action(dev, devm_clk_disable_unprepare, clk);
+	if (ret) {
+		clk_disable_unprepare(clk);
 		goto out_put_clk;
+	}
 
 	return clk;
 
-- 
2.51.2


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

end of thread, other threads:[~2026-09-04  8:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-04  7:50 [PATCH] clk: devres: make clock cleanup explicit on failure Onur Özkan
2026-09-04  8:01 ` sashiko-bot
2026-09-04  8:12   ` Jerome Brunet

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.