summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-19 17:00:32 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-20 09:21:08 +0300
commitc3ba64bb3a6c8a4bc9fd3fd4e3a882e66f1942fa (patch)
tree3e01985ec934cec6553c3ccfd3a095761b565dcf
parent1cd969fdb447655e6f4b1e0a3213e27c7ad236c2 (diff)
downloadlinux-c3ba64bb3a6c8a4bc9fd3fd4e3a882e66f1942fa.tar.xz
Revert "net: phy: micrel: Restore led_mode and clk_sel on resume"
This reverts commit d7ba3c00047dfd88fe0360a2d27169b54c88c4f1 which was commit 79e498a9c7da0737829ff864aae44df434105676 upstream. Turns out it breaks things, so drop it. Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org> Cc: Leonard Crestez <leonard.crestez@nxp.com> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: David S. Miller <davem@davemloft.net> Cc: Sasha Levin <alexander.levin@microsoft.com> Cc: Dan Rue <dan.rue@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/net/phy/micrel.c42
1 files changed, 14 insertions, 28 deletions
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 4da73e2c37cf..2032a6de026b 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -268,12 +268,23 @@ out:
return ret;
}
-/* Some config bits need to be set again on resume, handle them here. */
-static int kszphy_config_reset(struct phy_device *phydev)
+static int kszphy_config_init(struct phy_device *phydev)
{
struct kszphy_priv *priv = phydev->priv;
+ const struct kszphy_type *type;
int ret;
+ if (!priv)
+ return 0;
+
+ type = priv->type;
+
+ if (type->has_broadcast_disable)
+ kszphy_broadcast_disable(phydev);
+
+ if (type->has_nand_tree_disable)
+ kszphy_nand_tree_disable(phydev);
+
if (priv->rmii_ref_clk_sel) {
ret = kszphy_rmii_clk_sel(phydev, priv->rmii_ref_clk_sel_val);
if (ret) {
@@ -284,7 +295,7 @@ static int kszphy_config_reset(struct phy_device *phydev)
}
if (priv->led_mode >= 0)
- kszphy_setup_led(phydev, priv->type->led_mode_reg, priv->led_mode);
+ kszphy_setup_led(phydev, type->led_mode_reg, priv->led_mode);
if (phy_interrupt_is_valid(phydev)) {
int ctl = phy_read(phydev, MII_BMCR);
@@ -300,25 +311,6 @@ static int kszphy_config_reset(struct phy_device *phydev)
return 0;
}
-static int kszphy_config_init(struct phy_device *phydev)
-{
- struct kszphy_priv *priv = phydev->priv;
- const struct kszphy_type *type;
-
- if (!priv)
- return 0;
-
- type = priv->type;
-
- if (type->has_broadcast_disable)
- kszphy_broadcast_disable(phydev);
-
- if (type->has_nand_tree_disable)
- kszphy_nand_tree_disable(phydev);
-
- return kszphy_config_reset(phydev);
-}
-
static int ksz8041_config_init(struct phy_device *phydev)
{
struct device_node *of_node = phydev->mdio.dev.of_node;
@@ -723,14 +715,8 @@ static int kszphy_suspend(struct phy_device *phydev)
static int kszphy_resume(struct phy_device *phydev)
{
- int ret;
-
genphy_resume(phydev);
- ret = kszphy_config_reset(phydev);
- if (ret)
- return ret;
-
/* Enable PHY Interrupts */
if (phy_interrupt_is_valid(phydev)) {
phydev->interrupts = PHY_INTERRUPT_ENABLED;