Re: net: dsa: bcm_sf2: Use devm_clk_get_optional_enabled() in bcm_sf2_sw_probe()

From
Markus Elfring <hidden>
Date
2026-11-20 07:00:43
Also in
kernel-janitors, lkml
Reply to
Florian Fainelli, 2026-11-19
quoted
NACK, this patch is wrong because the remove function and the error handling path of the probe need to be updated.
My bad you are right this creates the following regressions: devm_clk_get_optional_enabled() registers a devres action that calls clk_disable_unprepare() on detach. The patch leaves the manual
clk_disable_unprepare(priv->clk) in two places in drivers/net/dsa/bcm_sf2.c: the probe error path (out_clk:) and bcm_sf2_sw_remove().

pw-bot: cr
Do you expect more functionality from a devm_clk_get_optional_enabled() call
than from the combination of devm_clk_get_optional() and clk_prepare_enable() so far?

https://elixir.bootlin.com/linux/v7.4-rc1/source/include/linux/clk.h#L680-L699
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/driver-api/driver-model/devres.rst?id=d220c9443db6e5f20a60cad55c6a0ae7a75c63b8#n242

https://elixir.bootlin.com/linux/v7.4-rc1/source/drivers/net/dsa/bcm_sf2.c#L1365-L1568

Regards,
Markus
Thread (7 messages) 7 messages, 4 authors, last reply 10d ago
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