mirror of https://github.com/torvalds/linux.git
net: mdio_bus: Use devm for getting reset GPIO
Commitbafbdd527d("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 commit40ba6a12a5("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:bafbdd527d("phylib: Add device reset GPIO support") Fixes:40ba6a12a5("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>
This commit is contained in:
parent
57ec5a8735
commit
3b98c93525
|
|
@ -36,7 +36,7 @@
|
|||
static int mdiobus_register_gpiod(struct mdio_device *mdiodev)
|
||||
{
|
||||
/* Deassert the optional reset signal */
|
||||
mdiodev->reset_gpio = gpiod_get_optional(&mdiodev->dev,
|
||||
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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue