Commit df22de9a authored by Michael Walle's avatar Michael Walle Committed by David S. Miller

net: phy: icplus: use the .soft_reset() of the phy-core

The PHY core already resets the PHY before .config_init() if a
.soft_reset() op is registered. Drop the open-coded ip1xx_reset().
Signed-off-by: default avatarMichael Walle <michael@walle.cc>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8edf206c
...@@ -120,36 +120,10 @@ static int ip175c_config_init(struct phy_device *phydev) ...@@ -120,36 +120,10 @@ static int ip175c_config_init(struct phy_device *phydev)
return 0; return 0;
} }
static int ip1xx_reset(struct phy_device *phydev)
{
int bmcr;
/* Software Reset PHY */
bmcr = phy_read(phydev, MII_BMCR);
if (bmcr < 0)
return bmcr;
bmcr |= BMCR_RESET;
bmcr = phy_write(phydev, MII_BMCR, bmcr);
if (bmcr < 0)
return bmcr;
do {
bmcr = phy_read(phydev, MII_BMCR);
if (bmcr < 0)
return bmcr;
} while (bmcr & BMCR_RESET);
return 0;
}
static int ip1001_config_init(struct phy_device *phydev) static int ip1001_config_init(struct phy_device *phydev)
{ {
int c; int c;
c = ip1xx_reset(phydev);
if (c < 0)
return c;
/* Enable Auto Power Saving mode */ /* Enable Auto Power Saving mode */
c = phy_read(phydev, IP1001_SPEC_CTRL_STATUS_2); c = phy_read(phydev, IP1001_SPEC_CTRL_STATUS_2);
if (c < 0) if (c < 0)
...@@ -237,10 +211,6 @@ static int ip101a_g_config_init(struct phy_device *phydev) ...@@ -237,10 +211,6 @@ static int ip101a_g_config_init(struct phy_device *phydev)
struct ip101a_g_phy_priv *priv = phydev->priv; struct ip101a_g_phy_priv *priv = phydev->priv;
int err, c; int err, c;
c = ip1xx_reset(phydev);
if (c < 0)
return c;
/* configure the RXER/INTR_32 pin of the 32-pin IP101GR if needed: */ /* configure the RXER/INTR_32 pin of the 32-pin IP101GR if needed: */
switch (priv->sel_intr32) { switch (priv->sel_intr32) {
case IP101GR_SEL_INTR32_RXER: case IP101GR_SEL_INTR32_RXER:
...@@ -346,6 +316,7 @@ static struct phy_driver icplus_driver[] = { ...@@ -346,6 +316,7 @@ static struct phy_driver icplus_driver[] = {
.name = "ICPlus IP1001", .name = "ICPlus IP1001",
/* PHY_GBIT_FEATURES */ /* PHY_GBIT_FEATURES */
.config_init = ip1001_config_init, .config_init = ip1001_config_init,
.soft_reset = genphy_soft_reset,
.suspend = genphy_suspend, .suspend = genphy_suspend,
.resume = genphy_resume, .resume = genphy_resume,
}, { }, {
...@@ -356,6 +327,7 @@ static struct phy_driver icplus_driver[] = { ...@@ -356,6 +327,7 @@ static struct phy_driver icplus_driver[] = {
.config_intr = ip101a_g_config_intr, .config_intr = ip101a_g_config_intr,
.handle_interrupt = ip101a_g_handle_interrupt, .handle_interrupt = ip101a_g_handle_interrupt,
.config_init = ip101a_g_config_init, .config_init = ip101a_g_config_init,
.soft_reset = genphy_soft_reset,
.suspend = genphy_suspend, .suspend = genphy_suspend,
.resume = genphy_resume, .resume = genphy_resume,
} }; } };
......
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