Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers: net: phy: xgene: Fix 'remove' function

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>

authored by

Christophe Jaillet and committed by
David S. Miller
440f895a 715f5552

+2 -4
+2 -4
drivers/net/phy/mdio-xgene.c
··· 424 424 mdiobus_unregister(mdio_bus); 425 425 mdiobus_free(mdio_bus); 426 426 427 - if (dev->of_node) { 428 - if (IS_ERR(pdata->clk)) 429 - clk_disable_unprepare(pdata->clk); 430 - } 427 + if (dev->of_node) 428 + clk_disable_unprepare(pdata->clk); 431 429 432 430 return 0; 433 431 }