diff mbox series

net: stmmac: fix reset gpio free missing

Message ID 20190522175558.59b21673@xhacker.debian
State Accepted
Delegated to: David Miller
Headers show
Series net: stmmac: fix reset gpio free missing | expand

Commit Message

Jisheng Zhang May 22, 2019, 10:05 a.m. UTC
Commit 984203ceff27 ("net: stmmac: mdio: remove reset gpio free")
removed the reset gpio free, when the driver is unbinded or rmmod,
we miss the gpio free.

This patch uses managed API to request the reset gpio, so that the
gpio could be freed properly.

Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Fixes: 984203ceff27 ("net: stmmac: mdio: remove reset gpio free")
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

David Miller May 23, 2019, 12:29 a.m. UTC | #1
From: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Date: Wed, 22 May 2019 10:05:09 +0000

> Commit 984203ceff27 ("net: stmmac: mdio: remove reset gpio free")
> removed the reset gpio free, when the driver is unbinded or rmmod,
> we miss the gpio free.
> 
> This patch uses managed API to request the reset gpio, so that the
> gpio could be freed properly.
> 
> Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
> Fixes: 984203ceff27 ("net: stmmac: mdio: remove reset gpio free")

Please put the Fixes: tag first in the list of tags in the future.

Applied, thank you.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
index bdd351597b55..093a223fe408 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
@@ -267,7 +267,8 @@  int stmmac_mdio_reset(struct mii_bus *bus)
 			of_property_read_u32_array(np,
 				"snps,reset-delays-us", data->delays, 3);
 
-			if (gpio_request(data->reset_gpio, "mdio-reset"))
+			if (devm_gpio_request(priv->device, data->reset_gpio,
+					      "mdio-reset"))
 				return 0;
 		}