Skip to content

Commit 3b98c93

Browse files
Bence Csókáskuba-moo
authored andcommitted
net: mdio_bus: Use devm for getting reset GPIO
Commit bafbdd5 ("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 40ba6a1 ("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: bafbdd5 ("phylib: Add device reset GPIO support") Fixes: 40ba6a1 ("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> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/20250728153455.47190-2-csokas.bence@prolan.hu Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 57ec5a8 commit 3b98c93

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/phy/mdio_bus.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
static int mdiobus_register_gpiod(struct mdio_device *mdiodev)
3737
{
3838
/* Deassert the optional reset signal */
39-
mdiodev->reset_gpio = gpiod_get_optional(&mdiodev->dev,
40-
"reset", GPIOD_OUT_LOW);
39+
mdiodev->reset_gpio = devm_gpiod_get_optional(&mdiodev->dev,
40+
"reset", GPIOD_OUT_LOW);
4141
if (IS_ERR(mdiodev->reset_gpio))
4242
return PTR_ERR(mdiodev->reset_gpio);
4343

0 commit comments

Comments
 (0)