Skip to content

Commit

Permalink
phy: mdio-sun4i: add missed regulator_disable in remove
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chuhong Yuan authored and David S. Miller committed Nov 19, 2019
1 parent 2744bf4 commit 39c68b3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/phy/mdio-sun4i.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 39c68b3

Please sign in to comment.