[U-Boot] [PATCH 3/7] net/designware: Phy address fix

Amit Virdi amit.virdi at st.com
Wed Feb 29 11:37:22 CET 2012


From: Vipin KUMAR <vipin.kumar at st.com>

The code assumes the phy address to be > 0, which is not true, the phy address
can be in the range 0-31.

Signed-off-by: Vipin Kumar <vipin.kumar at st.com>
Signed-off-by: Amit Virdi <amit.virdi at st.com>
---
 drivers/net/designware.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 754ffae..5847c17 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -383,7 +383,7 @@ static int configure_phy(struct eth_device *dev)
 
 #if defined(CONFIG_DW_SEARCH_PHY)
 	phy_addr = find_phy(dev);
-	if (phy_addr > 0)
+	if (phy_addr >= 0)
 		priv->address = phy_addr;
 	else
 		return -1;
-- 
1.7.2.2



More information about the U-Boot mailing list