linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] phy: mdio-sun4i: add missed regulator_disable in remove
@ 2019-11-18 11:41 Chuhong Yuan
  2019-11-19  1:23 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Chuhong Yuan @ 2019-11-18 11:41 UTC (permalink / raw)
  Cc: Andrew Lunn, Florian Fainelli, Heiner Kallweit, David S . Miller,
	Maxime Ripard, Chen-Yu Tsai, netdev, linux-arm-kernel,
	linux-kernel, Chuhong Yuan

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>
---
 drivers/net/phy/mdio-sun4i.c | 3 +++
 1 file changed, 3 insertions(+)

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 @@ 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;
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] phy: mdio-sun4i: add missed regulator_disable in remove
  2019-11-18 11:41 [PATCH] phy: mdio-sun4i: add missed regulator_disable in remove Chuhong Yuan
@ 2019-11-19  1:23 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-11-19  1:23 UTC (permalink / raw)
  To: hslester96
  Cc: andrew, f.fainelli, hkallweit1, mripard, wens, netdev,
	linux-arm-kernel, linux-kernel

From: Chuhong Yuan <hslester96@gmail.com>
Date: Mon, 18 Nov 2019 19:41:15 +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>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-11-19  1:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-18 11:41 [PATCH] phy: mdio-sun4i: add missed regulator_disable in remove Chuhong Yuan
2019-11-19  1:23 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).