Skip to content

Commit

Permalink
bcm63xx_enet: drop unneeded NULL phy_clk check
Browse files Browse the repository at this point in the history
clk_disable and clk_unprepare are NULL-safe, so need to duplicate the
NULL check of the functions.

Signed-off-by: Jonas Gorski <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
KanjiMonster authored and davem330 committed Oct 2, 2017
1 parent 7e697ce commit 4e78e5c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/net/ethernet/broadcom/bcm63xx_enet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1903,8 +1903,7 @@ static int bcm_enet_probe(struct platform_device *pdev)
out_uninit_hw:
/* turn off mdc clock */
enet_writel(priv, 0, ENET_MIISC_REG);
if (priv->phy_clk)
clk_disable_unprepare(priv->phy_clk);
clk_disable_unprepare(priv->phy_clk);

out_disable_clk_mac:
clk_disable_unprepare(priv->mac_clk);
Expand Down Expand Up @@ -1943,9 +1942,7 @@ static int bcm_enet_remove(struct platform_device *pdev)
}

/* disable hw block clocks */
if (priv->phy_clk)
clk_disable_unprepare(priv->phy_clk);

clk_disable_unprepare(priv->phy_clk);
clk_disable_unprepare(priv->mac_clk);

free_netdev(dev);
Expand Down

0 comments on commit 4e78e5c

Please sign in to comment.