Skip to content

Commit

Permalink
net: ethoc: Remove useless test before clk_disable_unprepare
Browse files Browse the repository at this point in the history
clk_disable_unprepare() already checks that the clock pointer is valid.
No need to test it before calling it.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
YueHaibing authored and David S. Miller committed May 16, 2018
1 parent 93120eb commit 76e597e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/net/ethernet/ethoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1246,8 +1246,7 @@ static int ethoc_probe(struct platform_device *pdev)
mdiobus_unregister(priv->mdio);
mdiobus_free(priv->mdio);
free2:
if (priv->clk)
clk_disable_unprepare(priv->clk);
clk_disable_unprepare(priv->clk);
free:
free_netdev(netdev);
out:
Expand All @@ -1271,8 +1270,7 @@ static int ethoc_remove(struct platform_device *pdev)
mdiobus_unregister(priv->mdio);
mdiobus_free(priv->mdio);
}
if (priv->clk)
clk_disable_unprepare(priv->clk);
clk_disable_unprepare(priv->clk);
unregister_netdev(netdev);
free_netdev(netdev);
}
Expand Down

0 comments on commit 76e597e

Please sign in to comment.