summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/stmicro
diff options
context:
space:
mode:
authorFabrice Gasnier <fabrice.gasnier@st.com>2016-02-29 14:27:40 +0100
committerDavid S. Miller <davem@davemloft.net>2016-03-02 14:21:33 -0500
commit8ecd80a5f6a7e31824c0d49e10c3cf6825c6c291 (patch)
tree429147aa00aff247a479792f3dfa970997cd005b /drivers/net/ethernet/stmicro
parent8e99fc5f887a072ee023eb9a3240eba85e768734 (diff)
downloadlinux-stable-8ecd80a5f6a7e31824c0d49e10c3cf6825c6c291.tar.gz
linux-stable-8ecd80a5f6a7e31824c0d49e10c3cf6825c6c291.tar.bz2
linux-stable-8ecd80a5f6a7e31824c0d49e10c3cf6825c6c291.zip
stmmac: fix phy init when attached to a phy
phy_bus_name can be NULL when "fixed-link" property isn't used. Then, since "stmmac: do not poll phy handler when attach a switch", phy_bus_name ptr needs to be checked before strcmp is called. Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: Alexandre TORGUE <alexandre.torgue@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index eab7ac0f5bc1..3cc135559a1d 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -868,8 +868,9 @@ static int stmmac_init_phy(struct net_device *dev)
}
/* If attached to a switch, there is no reason to poll phy handler */
- if (!strcmp(priv->plat->phy_bus_name, "fixed"))
- phydev->irq = PHY_IGNORE_INTERRUPT;
+ if (priv->plat->phy_bus_name)
+ if (!strcmp(priv->plat->phy_bus_name, "fixed"))
+ phydev->irq = PHY_IGNORE_INTERRUPT;
pr_debug("stmmac_init_phy: %s: attached to PHY (UID 0x%x)"
" Link = %d\n", dev->name, phydev->phy_id, phydev->link);