linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: mdio_bus: Use devm for getting reset GPIO
@ 2025-07-28 15:34 Bence Csókás
  2025-07-31  1:16 ` Jakub Kicinski
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Bence Csókás @ 2025-07-28 15:34 UTC (permalink / raw)
  To: Geert Uytterhoeven, Sergei Shtylyov, David S. Miller, Rob Herring,
	Andrew Lunn, Andy Shevchenko, Dmitry Torokhov, netdev,
	linux-kernel
  Cc: Bence Csókás, Csaba Buday, Heiner Kallweit,
	Russell King, Eric Dumazet, Jakub Kicinski, Paolo Abeni

Commit bafbdd527d56 ("phylib: Add device reset GPIO support") removed
devm_gpiod_get_optional() in favor of the non-devres managed
fwnode_get_named_gpiod(). When it was kind-of reverted by commit
40ba6a12a548 ("net: mdio: switch to using gpiod_get_optional()"), the devm
functionality was not reinstated. Nor was the GPIO unclaimed on device
remove. This leads to the GPIO being claimed indefinitely, even when the
device and/or the driver gets removed.

Fixes: bafbdd527d56 ("phylib: Add device reset GPIO support")
Fixes: 40ba6a12a548 ("net: mdio: switch to using gpiod_get_optional()")
Cc: Csaba Buday <buday.csaba@prolan.hu>
Signed-off-by: Bence Csókás <csokas.bence@prolan.hu>
---
 drivers/net/phy/mdio_bus.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index fda2e27c1810..24bdab5bdd24 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -36,8 +36,8 @@
 static int mdiobus_register_gpiod(struct mdio_device *mdiodev)
 {
 	/* Deassert the optional reset signal */
-	mdiodev->reset_gpio = gpiod_get_optional(&mdiodev->dev,
-						 "reset", GPIOD_OUT_LOW);
+	mdiodev->reset_gpio = devm_gpiod_get_optional(&mdiodev->dev,
+						      "reset", GPIOD_OUT_LOW);
 	if (IS_ERR(mdiodev->reset_gpio))
 		return PTR_ERR(mdiodev->reset_gpio);
 

base-commit: fa582ca7e187a15e772e6a72fe035f649b387a60
-- 
2.43.0



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

end of thread, other threads:[~2025-08-07  8:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-28 15:34 [PATCH net] net: mdio_bus: Use devm for getting reset GPIO Bence Csókás
2025-07-31  1:16 ` Jakub Kicinski
2025-07-31  1:20   ` Andrew Lunn
2025-08-07  8:12   ` Csókás Bence
2025-07-31  2:20 ` patchwork-bot+netdevbpf
2025-08-01 12:34   ` Russell King (Oracle)
2025-08-01 12:01 ` Mark Brown
2025-08-01 12:25   ` Geert Uytterhoeven
2025-08-01 12:33     ` Russell King (Oracle)
2025-08-01 13:04       ` Csókás Bence
2025-08-01 13:15         ` Russell King (Oracle)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).