linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: phy: at803x: disable vddio regulator
@ 2020-01-30 17:54 Michael Walle
  2020-01-30 17:58 ` Florian Fainelli
  2020-01-31 15:58 ` Jakub Kicinski
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Walle @ 2020-01-30 17:54 UTC (permalink / raw)
  To: linux-kernel, netdev
  Cc: David S . Miller, Russell King, Heiner Kallweit,
	Florian Fainelli, Andrew Lunn, Michael Walle

The probe() might enable a VDDIO regulator, which needs to be disabled
again before calling regulator_put(). Add a remove() function.

Fixes: 2f664823a470 ("net: phy: at803x: add device tree binding")
Signed-off-by: Michael Walle <michael@walle.cc>
---
 drivers/net/phy/at803x.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
index aee62610bade..481cf48c9b9e 100644
--- a/drivers/net/phy/at803x.c
+++ b/drivers/net/phy/at803x.c
@@ -489,6 +489,14 @@ static int at803x_probe(struct phy_device *phydev)
 	return at803x_parse_dt(phydev);
 }
 
+static void at803x_remove(struct phy_device *phydev)
+{
+	struct at803x_priv *priv = phydev->priv;
+
+	if (priv->vddio)
+		regulator_disable(priv->vddio);
+}
+
 static int at803x_clk_out_config(struct phy_device *phydev)
 {
 	struct at803x_priv *priv = phydev->priv;
@@ -711,6 +719,7 @@ static struct phy_driver at803x_driver[] = {
 	.name			= "Qualcomm Atheros AR8035",
 	.phy_id_mask		= AT803X_PHY_ID_MASK,
 	.probe			= at803x_probe,
+	.remove			= at803x_remove,
 	.config_init		= at803x_config_init,
 	.set_wol		= at803x_set_wol,
 	.get_wol		= at803x_get_wol,
@@ -726,6 +735,7 @@ static struct phy_driver at803x_driver[] = {
 	.name			= "Qualcomm Atheros AR8030",
 	.phy_id_mask		= AT803X_PHY_ID_MASK,
 	.probe			= at803x_probe,
+	.remove			= at803x_remove,
 	.config_init		= at803x_config_init,
 	.link_change_notify	= at803x_link_change_notify,
 	.set_wol		= at803x_set_wol,
@@ -741,6 +751,7 @@ static struct phy_driver at803x_driver[] = {
 	.name			= "Qualcomm Atheros AR8031/AR8033",
 	.phy_id_mask		= AT803X_PHY_ID_MASK,
 	.probe			= at803x_probe,
+	.remove			= at803x_remove,
 	.config_init		= at803x_config_init,
 	.set_wol		= at803x_set_wol,
 	.get_wol		= at803x_get_wol,
-- 
2.20.1


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

* Re: [PATCH net-next] net: phy: at803x: disable vddio regulator
  2020-01-30 17:54 [PATCH net-next] net: phy: at803x: disable vddio regulator Michael Walle
@ 2020-01-30 17:58 ` Florian Fainelli
  2020-01-31 15:58 ` Jakub Kicinski
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2020-01-30 17:58 UTC (permalink / raw)
  To: Michael Walle, linux-kernel, netdev
  Cc: David S . Miller, Russell King, Heiner Kallweit, Andrew Lunn

On 1/30/20 9:54 AM, Michael Walle wrote:
> The probe() might enable a VDDIO regulator, which needs to be disabled
> again before calling regulator_put(). Add a remove() function.
> 
> Fixes: 2f664823a470 ("net: phy: at803x: add device tree binding")
> Signed-off-by: Michael Walle <michael@walle.cc>
> ---

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

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

* Re: [PATCH net-next] net: phy: at803x: disable vddio regulator
  2020-01-30 17:54 [PATCH net-next] net: phy: at803x: disable vddio regulator Michael Walle
  2020-01-30 17:58 ` Florian Fainelli
@ 2020-01-31 15:58 ` Jakub Kicinski
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2020-01-31 15:58 UTC (permalink / raw)
  To: Michael Walle
  Cc: linux-kernel, netdev, David S . Miller, Russell King,
	Heiner Kallweit, Florian Fainelli, Andrew Lunn

On Thu, 30 Jan 2020 18:54:02 +0100, Michael Walle wrote:
> The probe() might enable a VDDIO regulator, which needs to be disabled
> again before calling regulator_put(). Add a remove() function.
> 
> Fixes: 2f664823a470 ("net: phy: at803x: add device tree binding")
> Signed-off-by: Michael Walle <michael@walle.cc>

Applied, thank you!

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

end of thread, other threads:[~2020-01-31 15:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-30 17:54 [PATCH net-next] net: phy: at803x: disable vddio regulator Michael Walle
2020-01-30 17:58 ` Florian Fainelli
2020-01-31 15:58 ` Jakub Kicinski

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).