Skip to content

Commit 2318ca8

Browse files
mwallekuba-moo
authored andcommitted
net: phy: at803x: disable vddio regulator
The probe() might enable a VDDIO regulator, which needs to be disabled again before calling regulator_put(). Add a remove() function. Fixes: 2f66482 ("net: phy: at803x: add device tree binding") Signed-off-by: Michael Walle <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 2e1bf3a commit 2318ca8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/net/phy/at803x.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,14 @@ static int at803x_probe(struct phy_device *phydev)
489489
return at803x_parse_dt(phydev);
490490
}
491491

492+
static void at803x_remove(struct phy_device *phydev)
493+
{
494+
struct at803x_priv *priv = phydev->priv;
495+
496+
if (priv->vddio)
497+
regulator_disable(priv->vddio);
498+
}
499+
492500
static int at803x_clk_out_config(struct phy_device *phydev)
493501
{
494502
struct at803x_priv *priv = phydev->priv;
@@ -711,6 +719,7 @@ static struct phy_driver at803x_driver[] = {
711719
.name = "Qualcomm Atheros AR8035",
712720
.phy_id_mask = AT803X_PHY_ID_MASK,
713721
.probe = at803x_probe,
722+
.remove = at803x_remove,
714723
.config_init = at803x_config_init,
715724
.set_wol = at803x_set_wol,
716725
.get_wol = at803x_get_wol,
@@ -726,6 +735,7 @@ static struct phy_driver at803x_driver[] = {
726735
.name = "Qualcomm Atheros AR8030",
727736
.phy_id_mask = AT803X_PHY_ID_MASK,
728737
.probe = at803x_probe,
738+
.remove = at803x_remove,
729739
.config_init = at803x_config_init,
730740
.link_change_notify = at803x_link_change_notify,
731741
.set_wol = at803x_set_wol,
@@ -741,6 +751,7 @@ static struct phy_driver at803x_driver[] = {
741751
.name = "Qualcomm Atheros AR8031/AR8033",
742752
.phy_id_mask = AT803X_PHY_ID_MASK,
743753
.probe = at803x_probe,
754+
.remove = at803x_remove,
744755
.config_init = at803x_config_init,
745756
.set_wol = at803x_set_wol,
746757
.get_wol = at803x_get_wol,

0 commit comments

Comments
 (0)