Skip to content
Snippets Groups Projects
Commit f0ece9e9 authored by Mike Frysinger's avatar Mike Frysinger Committed by Wolfgang Denk
Browse files

net: designware: fix uninitialized phy_addr usage


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: default avatarMike Frysinger <vapier@gentoo.org>
Reviewed-by: default avatarVipin Kumar <vipin.kumar@st.com>

Fix commit message.
Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
parent ee7f5bfd
Branches
Tags
No related merge requests found
...@@ -383,6 +383,8 @@ static int configure_phy(struct eth_device *dev) ...@@ -383,6 +383,8 @@ static int configure_phy(struct eth_device *dev)
priv->address = phy_addr; priv->address = phy_addr;
else else
return -1; return -1;
#else
phy_addr = priv->address;
#endif #endif
if (dw_reset_phy(dev) < 0) if (dw_reset_phy(dev) < 0)
return -1; return -1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment