Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Chuhong Yuan and committed by
David S. Miller
39c68b3f 2744bf42

+3
+3
drivers/net/phy/mdio-sun4i.c
··· 145 145 static int sun4i_mdio_remove(struct platform_device *pdev) 146 146 { 147 147 struct mii_bus *bus = platform_get_drvdata(pdev); 148 + struct sun4i_mdio_data *data = bus->priv; 148 149 149 150 mdiobus_unregister(bus); 151 + if (data->regulator) 152 + regulator_disable(data->regulator); 150 153 mdiobus_free(bus); 151 154 152 155 return 0;