Skip to content

Commit cebd2ca

Browse files
Zhang Changzhongdavem330
authored andcommitted
net: fs_enet: remove redundant null check
Because clk_prepare_enable and clk_disable_unprepare already checked NULL clock parameter, so the additional checks are unnecessary, just remove them. Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 87c831c commit cebd2ca

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,8 +1043,7 @@ static int fs_enet_probe(struct platform_device *ofdev)
10431043
out_free_dev:
10441044
free_netdev(ndev);
10451045
out_put:
1046-
if (fpi->clk_per)
1047-
clk_disable_unprepare(fpi->clk_per);
1046+
clk_disable_unprepare(fpi->clk_per);
10481047
out_deregister_fixed_link:
10491048
of_node_put(fpi->phy_node);
10501049
if (of_phy_is_fixed_link(ofdev->dev.of_node))
@@ -1065,8 +1064,7 @@ static int fs_enet_remove(struct platform_device *ofdev)
10651064
fep->ops->cleanup_data(ndev);
10661065
dev_set_drvdata(fep->dev, NULL);
10671066
of_node_put(fep->fpi->phy_node);
1068-
if (fep->fpi->clk_per)
1069-
clk_disable_unprepare(fep->fpi->clk_per);
1067+
clk_disable_unprepare(fep->fpi->clk_per);
10701068
if (of_phy_is_fixed_link(ofdev->dev.of_node))
10711069
of_phy_deregister_fixed_link(ofdev->dev.of_node);
10721070
free_netdev(ndev);

0 commit comments

Comments
 (0)