Skip to contentSkip to conversation

phy: mdio-sun4i: add missed regulator_disable in remove

PATCH Applied Chuhong Yuan 2 participants 2 messages Nov 18, 2019 – Nov 19, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/net/phy/mdio-sun4i.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/phy/mdio-sun4i.c +3 -0
index 58d6504495e0..f798de3276dc 100644
@@ -145,8 +145,11 @@ static int sun4i_mdio_probe(struct platform_device *pdev)
 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;
Signature · 1 line
2.24.0