Commit 3a8b5cda authored by Jisheng Zhang's avatar Jisheng Zhang Committed by Kleber Sacilotto de Souza

net: stmmac: fix reset gpio free missing

BugLink: https://bugs.launchpad.net/bugs/1832661

[ Upstream commit 49ce881c ]

Commit 984203ce ("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.

Fixes: 984203ce ("net: stmmac: mdio: remove reset gpio free")
Signed-off-by: default avatarJisheng Zhang <Jisheng.Zhang@synaptics.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 60f1d01c
...@@ -154,7 +154,8 @@ int stmmac_mdio_reset(struct mii_bus *bus) ...@@ -154,7 +154,8 @@ int stmmac_mdio_reset(struct mii_bus *bus)
of_property_read_u32_array(np, of_property_read_u32_array(np,
"snps,reset-delays-us", data->delays, 3); "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; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment