summaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/marvell.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2019-12-17 14:39:31 +0100
committerDavid S. Miller <davem@davemloft.net>2019-12-19 21:52:34 +0100
commit760fa78f3509d3d414804c4017de3d0dba995081 (patch)
treeb4eda0dd8c1251ec275b4c1ab2f7dae55f8044dc /drivers/net/phy/marvell.c
parentnet: phy: marvell: initialise link partner state earlier (diff)
downloadlinux-760fa78f3509d3d414804c4017de3d0dba995081.tar.xz
linux-760fa78f3509d3d414804c4017de3d0dba995081.zip
net: phy: marvell: use positive logic for link state
Rather than using negative logic: if (there is no link) set link = 0 else set link = 1 use the more natural positive logic: if (there is link) set link = 1 else set link = 0 Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/marvell.c')
-rw-r--r--drivers/net/phy/marvell.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index b50c8a4710b4..5900281f4c2c 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -174,7 +174,6 @@
#define ADVERTISE_PAUSE_FIBER 0x180
#define ADVERTISE_PAUSE_ASYM_FIBER 0x100
-#define REGISTER_LINK_STATUS 0x400
#define NB_FIBER_STATS 1
MODULE_DESCRIPTION("Marvell PHY driver");
@@ -1327,10 +1326,10 @@ static int marvell_update_link(struct phy_device *phydev, int fiber)
if (status < 0)
return status;
- if ((status & REGISTER_LINK_STATUS) == 0)
- phydev->link = 0;
- else
+ if (status & MII_M1011_PHY_STATUS_LINK)
phydev->link = 1;
+ else
+ phydev->link = 0;
} else {
return genphy_update_link(phydev);
}