phy: mdio-sun4i: add missed regulator_disable in remove
authorChuhong Yuan <hslester96@gmail.com>
Mon, 18 Nov 2019 11:41:15 +0000 (19:41 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Nov 2019 01:22:40 +0000 (17:22 -0800)
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>
drivers/net/phy/mdio-sun4i.c

index 58d6504..f798de3 100644 (file)
@@ -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;