aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2014-02-24 19:56:11 -0500
committerDavid S. Miller <davem@davemloft.net>2014-02-24 20:26:36 -0500
commit80d8e96d127a91dc3f298e9bb959473b9df1063a (patch)
treeb475b79452eb058decdf9c1f0dca7dd6222a08f7 /drivers/net/ethernet/broadcom
parent432c5b3a108c7e5185e34c4f25dc61824740c21d (diff)
net: bcmgenet: drop checks on priv->phydev
Drop all the checks on priv->phydev since we will refuse probing the driver if we cannot attach to a PHY device. Drop all checks on priv->phydev. This also fixes some smatch issues reported by Dan Carpenter. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom')
-rw-r--r--drivers/net/ethernet/broadcom/genet/bcmgenet.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index 192069d2745e..585645749d6d 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -732,8 +732,7 @@ static void bcmgenet_power_down(struct bcmgenet_priv *priv,
732 732
733 switch (mode) { 733 switch (mode) {
734 case GENET_POWER_CABLE_SENSE: 734 case GENET_POWER_CABLE_SENSE:
735 if (priv->phydev) 735 phy_detach(priv->phydev);
736 phy_detach(priv->phydev);
737 break; 736 break;
738 737
739 case GENET_POWER_PASSIVE: 738 case GENET_POWER_PASSIVE:
@@ -1811,9 +1810,8 @@ static void bcmgenet_irq_task(struct work_struct *work)
1811 /* Link UP/DOWN event */ 1810 /* Link UP/DOWN event */
1812 if ((priv->hw_params->flags & GENET_HAS_MDIO_INTR) && 1811 if ((priv->hw_params->flags & GENET_HAS_MDIO_INTR) &&
1813 (priv->irq0_stat & (UMAC_IRQ_LINK_UP|UMAC_IRQ_LINK_DOWN))) { 1812 (priv->irq0_stat & (UMAC_IRQ_LINK_UP|UMAC_IRQ_LINK_DOWN))) {
1814 if (priv->phydev) 1813 phy_mac_interrupt(priv->phydev,
1815 phy_mac_interrupt(priv->phydev, 1814 priv->irq0_stat & UMAC_IRQ_LINK_UP);
1816 (priv->irq0_stat & UMAC_IRQ_LINK_UP));
1817 priv->irq0_stat &= ~(UMAC_IRQ_LINK_UP|UMAC_IRQ_LINK_DOWN); 1815 priv->irq0_stat &= ~(UMAC_IRQ_LINK_UP|UMAC_IRQ_LINK_DOWN);
1818 } 1816 }
1819} 1817}
@@ -1931,8 +1929,7 @@ static int bcmgenet_wol_resume(struct bcmgenet_priv *priv)
1931 if (ret) 1929 if (ret)
1932 return ret; 1930 return ret;
1933 1931
1934 if (priv->phydev) 1932 phy_init_hw(priv->phydev);
1935 phy_init_hw(priv->phydev);
1936 /* Speed settings must be restored */ 1933 /* Speed settings must be restored */
1937 bcmgenet_mii_config(priv->dev); 1934 bcmgenet_mii_config(priv->dev);
1938 1935
@@ -2058,8 +2055,7 @@ static int bcmgenet_open(struct net_device *dev)
2058 2055
2059 netif_tx_start_all_queues(dev); 2056 netif_tx_start_all_queues(dev);
2060 2057
2061 if (priv->phydev) 2058 phy_start(priv->phydev);
2062 phy_start(priv->phydev);
2063 2059
2064 return 0; 2060 return 0;
2065 2061
@@ -2134,8 +2130,7 @@ static int bcmgenet_close(struct net_device *dev)
2134 2130
2135 netif_dbg(priv, ifdown, dev, "bcmgenet_close\n"); 2131 netif_dbg(priv, ifdown, dev, "bcmgenet_close\n");
2136 2132
2137 if (priv->phydev) 2133 phy_stop(priv->phydev);
2138 phy_stop(priv->phydev);
2139 2134
2140 /* Disable MAC receive */ 2135 /* Disable MAC receive */
2141 reg = bcmgenet_umac_readl(priv, UMAC_CMD); 2136 reg = bcmgenet_umac_readl(priv, UMAC_CMD);