Commit 2318ca8a authored by Michael Walle's avatar Michael Walle Committed by Jakub Kicinski

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: 2f664823 ("net: phy: at803x: add device tree binding")
Signed-off-by: default avatarMichael Walle <michael@walle.cc>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 2e1bf3a7
...@@ -489,6 +489,14 @@ static int at803x_probe(struct phy_device *phydev) ...@@ -489,6 +489,14 @@ static int at803x_probe(struct phy_device *phydev)
return at803x_parse_dt(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) static int at803x_clk_out_config(struct phy_device *phydev)
{ {
struct at803x_priv *priv = phydev->priv; struct at803x_priv *priv = phydev->priv;
...@@ -711,6 +719,7 @@ static struct phy_driver at803x_driver[] = { ...@@ -711,6 +719,7 @@ static struct phy_driver at803x_driver[] = {
.name = "Qualcomm Atheros AR8035", .name = "Qualcomm Atheros AR8035",
.phy_id_mask = AT803X_PHY_ID_MASK, .phy_id_mask = AT803X_PHY_ID_MASK,
.probe = at803x_probe, .probe = at803x_probe,
.remove = at803x_remove,
.config_init = at803x_config_init, .config_init = at803x_config_init,
.set_wol = at803x_set_wol, .set_wol = at803x_set_wol,
.get_wol = at803x_get_wol, .get_wol = at803x_get_wol,
...@@ -726,6 +735,7 @@ static struct phy_driver at803x_driver[] = { ...@@ -726,6 +735,7 @@ static struct phy_driver at803x_driver[] = {
.name = "Qualcomm Atheros AR8030", .name = "Qualcomm Atheros AR8030",
.phy_id_mask = AT803X_PHY_ID_MASK, .phy_id_mask = AT803X_PHY_ID_MASK,
.probe = at803x_probe, .probe = at803x_probe,
.remove = at803x_remove,
.config_init = at803x_config_init, .config_init = at803x_config_init,
.link_change_notify = at803x_link_change_notify, .link_change_notify = at803x_link_change_notify,
.set_wol = at803x_set_wol, .set_wol = at803x_set_wol,
...@@ -741,6 +751,7 @@ static struct phy_driver at803x_driver[] = { ...@@ -741,6 +751,7 @@ static struct phy_driver at803x_driver[] = {
.name = "Qualcomm Atheros AR8031/AR8033", .name = "Qualcomm Atheros AR8031/AR8033",
.phy_id_mask = AT803X_PHY_ID_MASK, .phy_id_mask = AT803X_PHY_ID_MASK,
.probe = at803x_probe, .probe = at803x_probe,
.remove = at803x_remove,
.config_init = at803x_config_init, .config_init = at803x_config_init,
.set_wol = at803x_set_wol, .set_wol = at803x_set_wol,
.get_wol = at803x_get_wol, .get_wol = at803x_get_wol,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment