Skip to content

Commit

Permalink
drivers: net: phy: xgene: Fix 'remove' function
Browse files Browse the repository at this point in the history
If 'IS_ERR(pdata->clk)' is true, then 'clk_disable_unprepare(pdata->clk)'
will do nothing.

It is likely that 'if (!IS_ERR(pdata->clk))' was expected here.
In fact, the test can even be removed because 'clk_disable_unprepare'
already handles such cases.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Christophe Jaillet authored and David S. Miller committed Sep 13, 2016
1 parent 715f555 commit 440f895
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/net/phy/mdio-xgene.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,8 @@ static int xgene_mdio_remove(struct platform_device *pdev)
mdiobus_unregister(mdio_bus);
mdiobus_free(mdio_bus);

if (dev->of_node) {
if (IS_ERR(pdata->clk))
clk_disable_unprepare(pdata->clk);
}
if (dev->of_node)
clk_disable_unprepare(pdata->clk);

return 0;
}
Expand Down

0 comments on commit 440f895

Please sign in to comment.