Re: [PATCH net-next v4 1/7] net: axienet: Fix resource release ordering

From
Andrew Lunn <andrew@lunn.ch>
Date
2025-08-05 20:59:25
Also in
linux-arm-kernel, lkml
Reply to
Sean Anderson, 2025-08-05
quoted hunk ↗ jump to hunk
+static void axienet_disable_misc(void *clocks)
+{
+	clk_bulk_disable_unprepare(XAE_NUM_MISC_CLOCKS, clocks);
+}
+
...
quoted hunk ↗ jump to hunk
 	ret = devm_clk_bulk_get_optional(&pdev->dev, XAE_NUM_MISC_CLOCKS, lp->misc_clks);
 	if (ret)
-		goto cleanup_clk;
+		return dev_err_probe(&pdev->dev, ret,
+				     "could not get misc. clocks\n");
 
 	ret = clk_bulk_prepare_enable(XAE_NUM_MISC_CLOCKS, lp->misc_clks);
 	if (ret)
-		goto cleanup_clk;
+		return dev_err_probe(&pdev->dev, ret,
+				     "could not enable misc. clocks\n");
+
+	ret = devm_add_action_or_reset(&pdev->dev, axienet_disable_misc,
+				       lp->misc_clks);
It seems like it would be better to add
devm_clk_bulk_get_optional_enable(). There is already an
devm_clk_bulk_get_all_enabled() so it does not seem like too big a
step.

	Andrew
Thread (21 messages) 21 messages, 4 authors, last reply 2025-12-16
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help