summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChuhong Yuan <hslester96@gmail.com>2019-11-18 19:41:15 +0800
committerDavid S. Miller <davem@davemloft.net>2019-11-18 17:22:40 -0800
commit39c68b3fc2c3c84ffdfdb867c136c5b41b29d6d0 (patch)
tree471524a3378c579164f4aa03d07602b6a88e772c
parent2744bf42680f64ebf2ee8a00354897857c073331 (diff)
phy: mdio-sun4i: add missed regulator_disable in remove
The driver forgets to disable the regulator in remove like what is done in probe failure. Add the missed call to fix it. Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/phy/mdio-sun4i.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/phy/mdio-sun4i.c b/drivers/net/phy/mdio-sun4i.c
index 58d6504495e0..f798de3276dc 100644
--- a/drivers/net/phy/mdio-sun4i.c
+++ b/drivers/net/phy/mdio-sun4i.c
@@ -145,8 +145,11 @@ err_out_free_mdiobus:
static int sun4i_mdio_remove(struct platform_device *pdev)
{
struct mii_bus *bus = platform_get_drvdata(pdev);
+ struct sun4i_mdio_data *data = bus->priv;
mdiobus_unregister(bus);
+ if (data->regulator)
+ regulator_disable(data->regulator);
mdiobus_free(bus);
return 0;