]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: designware: fix uninitialized phy_addr usage
authorMike Frysinger <vapier@gentoo.org>
Thu, 2 Jun 2011 05:19:38 +0000 (05:19 +0000)
committerWolfgang Denk <wd@denx.de>
Mon, 25 Jul 2011 20:20:10 +0000 (22:20 +0200)
When CONFIG_DW_SEARCH_PHY is disabled, the local phy_addr variable
never gets initialized which causes random behavior at runtime and a
gcc warning.  So set it by default to the stored phy address.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Reviewed-by: Vipin Kumar <vipin.kumar@st.com>
Fix commit message.
Signed-off-by: Wolfgang Denk <wd@denx.de>
drivers/net/designware.c

index 96f20d1138696d19f747d0f45a90f00ce7542994..bfa43842ac34b582a7f1796192b14fe09ce4ac6f 100644 (file)
@@ -383,6 +383,8 @@ static int configure_phy(struct eth_device *dev)
                priv->address = phy_addr;
        else
                return -1;
+#else
+       phy_addr = priv->address;
 #endif
        if (dw_reset_phy(dev) < 0)
                return -1;