diff options
author | Antoine Tenart <antoine.tenart@free-electrons.com> | 2017-08-30 10:29:16 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-30 15:17:46 -0700 |
commit | 968b211c620b567a4d2183beb0516cbd2c73560a (patch) | |
tree | c1ddc7a9cc5ad6366692c36842082a9612a65bba /drivers | |
parent | 542897d987b0d16c4346952f116acb80a8e82a38 (diff) | |
download | op-kernel-dev-968b211c620b567a4d2183beb0516cbd2c73560a.zip op-kernel-dev-968b211c620b567a4d2183beb0516cbd2c73560a.tar.gz |
net: mvpp2: simplify the link_event function
The link_event function is somewhat complicated. This cosmetic patch
simplifies it.
Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/marvell/mvpp2.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c index 3dc5f64..cacbd88 100644 --- a/drivers/net/ethernet/marvell/mvpp2.c +++ b/drivers/net/ethernet/marvell/mvpp2.c @@ -5740,7 +5740,6 @@ static void mvpp2_link_event(struct net_device *dev) { struct mvpp2_port *port = netdev_priv(dev); struct phy_device *phydev = dev->phydev; - int status_change = 0; u32 val; if (phydev->link) { @@ -5771,16 +5770,8 @@ static void mvpp2_link_event(struct net_device *dev) } if (phydev->link != port->link) { - if (!phydev->link) { - port->duplex = -1; - port->speed = 0; - } - port->link = phydev->link; - status_change = 1; - } - if (status_change) { if (phydev->link) { val = readl(port->base + MVPP2_GMAC_AUTONEG_CONFIG); val |= (MVPP2_GMAC_FORCE_LINK_PASS | @@ -5789,9 +5780,13 @@ static void mvpp2_link_event(struct net_device *dev) mvpp2_egress_enable(port); mvpp2_ingress_enable(port); } else { + port->duplex = -1; + port->speed = 0; + mvpp2_ingress_disable(port); mvpp2_egress_disable(port); } + phy_print_status(phydev); } } |