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 <[email protected]>
---
 drivers/net/phy/phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index ae37dd6c1e..419e6869c0 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -952,7 +952,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);
-- 
2.17.1

_______________________________________________
U-Boot mailing list
[email protected]
https://lists.denx.de/listinfo/u-boot

Reply via email to