Commit 9675db39 authored by Heiner Kallweit's avatar Heiner Kallweit Committed by David S. Miller

net: phy: aquantia: simplify aqr_config_aneg

Simplify aqr_config_aneg().
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent be67101f
......@@ -126,41 +126,22 @@ static int aqr_config_aneg(struct phy_device *phydev)
static int aqr_config_intr(struct phy_device *phydev)
{
bool en = phydev->interrupts == PHY_INTERRUPT_ENABLED;
int err;
if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
err = phy_write_mmd(phydev, MDIO_MMD_AN,
MDIO_AN_TX_VEND_INT_MASK2,
MDIO_AN_TX_VEND_INT_MASK2_LINK);
if (err < 0)
return err;
err = phy_write_mmd(phydev, MDIO_MMD_VEND1,
VEND1_GLOBAL_INT_STD_MASK,
VEND1_GLOBAL_INT_STD_MASK_ALL);
if (err < 0)
return err;
err = phy_write_mmd(phydev, MDIO_MMD_VEND1,
VEND1_GLOBAL_INT_VEND_MASK,
VEND1_GLOBAL_INT_VEND_MASK_GLOBAL3 |
VEND1_GLOBAL_INT_VEND_MASK_AN);
} else {
err = phy_write_mmd(phydev, MDIO_MMD_AN,
MDIO_AN_TX_VEND_INT_MASK2, 0);
if (err < 0)
return err;
err = phy_write_mmd(phydev, MDIO_MMD_VEND1,
VEND1_GLOBAL_INT_STD_MASK, 0);
if (err < 0)
return err;
err = phy_write_mmd(phydev, MDIO_MMD_VEND1,
VEND1_GLOBAL_INT_VEND_MASK, 0);
}
err = phy_write_mmd(phydev, MDIO_MMD_AN, MDIO_AN_TX_VEND_INT_MASK2,
en ? MDIO_AN_TX_VEND_INT_MASK2_LINK : 0);
if (err < 0)
return err;
err = phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_INT_STD_MASK,
en ? VEND1_GLOBAL_INT_STD_MASK_ALL : 0);
if (err < 0)
return err;
return err;
return phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_INT_VEND_MASK,
en ? VEND1_GLOBAL_INT_VEND_MASK_GLOBAL3 |
VEND1_GLOBAL_INT_VEND_MASK_AN : 0);
}
static int aqr_ack_interrupt(struct phy_device *phydev)
......
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