Skip to content

Commit

Permalink
net: stmmac: dwmac-intel-plat: remove redundant null check before clk…
Browse files Browse the repository at this point in the history
…_disable_unprepare()

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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Zhang Changzhong authored and David S. Miller committed Sep 9, 2020
1 parent a0d4851 commit 6b5472d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,7 @@ static int intel_eth_plat_probe(struct platform_device *pdev)

ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
if (ret) {
if (dwmac->tx_clk)
clk_disable_unprepare(dwmac->tx_clk);

clk_disable_unprepare(dwmac->tx_clk);
goto err_remove_config_dt;
}

Expand All @@ -169,9 +167,7 @@ static int intel_eth_plat_remove(struct platform_device *pdev)
int ret;

ret = stmmac_pltfr_remove(pdev);

if (dwmac->tx_clk)
clk_disable_unprepare(dwmac->tx_clk);
clk_disable_unprepare(dwmac->tx_clk);

return ret;
}
Expand Down

0 comments on commit 6b5472d

Please sign in to comment.