netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: pxa168_eth: remove redundant null check before clk_disable_unprepare()
@ 2020-09-09 14:06 Zhang Changzhong
  2020-09-09 21:18 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Zhang Changzhong @ 2020-09-09 14:06 UTC (permalink / raw)
  To: davem, kuba; +Cc: netdev, linux-kernel

Because clk_prepare_enable() and clk_disable_unprepare() already checked
NULL clock parameter, so the additional checks are unnecessary, just
remove them.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
---
 drivers/net/ethernet/marvell/pxa168_eth.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
index eb8cf60..faac94b 100644
--- a/drivers/net/ethernet/marvell/pxa168_eth.c
+++ b/drivers/net/ethernet/marvell/pxa168_eth.c
@@ -1541,10 +1541,8 @@ static int pxa168_eth_remove(struct platform_device *pdev)
 	}
 	if (dev->phydev)
 		phy_disconnect(dev->phydev);
-	if (pep->clk) {
-		clk_disable_unprepare(pep->clk);
-	}
 
+	clk_disable_unprepare(pep->clk);
 	mdiobus_unregister(pep->smi_bus);
 	mdiobus_free(pep->smi_bus);
 	unregister_netdev(dev);
-- 
2.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net: pxa168_eth: remove redundant null check before clk_disable_unprepare()
  2020-09-09 14:06 [PATCH net-next] net: pxa168_eth: remove redundant null check before clk_disable_unprepare() Zhang Changzhong
@ 2020-09-09 21:18 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-09-09 21:18 UTC (permalink / raw)
  To: zhangchangzhong; +Cc: kuba, netdev, linux-kernel

From: Zhang Changzhong <zhangchangzhong@huawei.com>
Date: Wed, 9 Sep 2020 22:06:37 +0800

> Because clk_prepare_enable() and clk_disable_unprepare() already checked
> NULL clock parameter, so the additional checks are unnecessary, just
> remove them.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-09 21:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-09 14:06 [PATCH net-next] net: pxa168_eth: remove redundant null check before clk_disable_unprepare() Zhang Changzhong
2020-09-09 21:18 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).