summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPriyanka Jain <priyanka.jain@nxp.com>2019-11-05 04:05:11 +0000
committerJoe Hershberger <joe.hershberger@ni.com>2019-12-09 09:47:42 -0600
commit1f60789602e0d5f5f9a8b507f25737c65b5d8daa (patch)
tree18fcb1a86d68ab135591226b69b0c57f5da7ec39
parenta6ab4b5470afadbc0f2a3d70437e3ccb88d8fa5c (diff)
net/phy: Fix phy_connect() for phy addr 0
Fix 'mask' calculation in phy_connect() for phy addr '0'. 'mask' is getting set to '0xffffffff' for phy addr '0' in phy_connect() whereas expected value is '0'. Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com> Reported-by: tetsu-aoki via github Acked-by: Joe Hershberger <joe.hershberger@ni.com>
-rw-r--r--drivers/net/phy/phy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index f2d17aa91a..6be0709e34 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -997,7 +997,7 @@ struct phy_device *phy_connect(struct mii_dev *bus, int addr,
#endif
{
struct phy_device *phydev = NULL;
- uint mask = (addr > 0) ? (1 << addr) : 0xffffffff;
+ uint mask = (addr >= 0) ? (1 << addr) : 0xffffffff;
#ifdef CONFIG_PHY_FIXED
phydev = phy_connect_fixed(bus, dev, interface);