fec: Do not enable/disable optional clocks unconditionally
clk_enet_out and clk_ptp are optional clocks, so we should not enable/disable them unconditionally. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
eda2977291
commit
9514fe7a23
@ -2105,7 +2105,9 @@ fec_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
clk_prepare_enable(fep->clk_ahb);
|
clk_prepare_enable(fep->clk_ahb);
|
||||||
clk_prepare_enable(fep->clk_ipg);
|
clk_prepare_enable(fep->clk_ipg);
|
||||||
|
if (fep->clk_enet_out)
|
||||||
clk_prepare_enable(fep->clk_enet_out);
|
clk_prepare_enable(fep->clk_enet_out);
|
||||||
|
if (fep->clk_ptp)
|
||||||
clk_prepare_enable(fep->clk_ptp);
|
clk_prepare_enable(fep->clk_ptp);
|
||||||
|
|
||||||
fep->reg_phy = devm_regulator_get(&pdev->dev, "phy");
|
fep->reg_phy = devm_regulator_get(&pdev->dev, "phy");
|
||||||
@ -2179,7 +2181,9 @@ failed_init:
|
|||||||
failed_regulator:
|
failed_regulator:
|
||||||
clk_disable_unprepare(fep->clk_ahb);
|
clk_disable_unprepare(fep->clk_ahb);
|
||||||
clk_disable_unprepare(fep->clk_ipg);
|
clk_disable_unprepare(fep->clk_ipg);
|
||||||
|
if (fep->clk_enet_out)
|
||||||
clk_disable_unprepare(fep->clk_enet_out);
|
clk_disable_unprepare(fep->clk_enet_out);
|
||||||
|
if (fep->clk_ptp)
|
||||||
clk_disable_unprepare(fep->clk_ptp);
|
clk_disable_unprepare(fep->clk_ptp);
|
||||||
failed_clk:
|
failed_clk:
|
||||||
failed_ioremap:
|
failed_ioremap:
|
||||||
@ -2206,9 +2210,11 @@ fec_drv_remove(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
if (fep->reg_phy)
|
if (fep->reg_phy)
|
||||||
regulator_disable(fep->reg_phy);
|
regulator_disable(fep->reg_phy);
|
||||||
|
if (fep->clk_ptp)
|
||||||
clk_disable_unprepare(fep->clk_ptp);
|
clk_disable_unprepare(fep->clk_ptp);
|
||||||
if (fep->ptp_clock)
|
if (fep->ptp_clock)
|
||||||
ptp_clock_unregister(fep->ptp_clock);
|
ptp_clock_unregister(fep->ptp_clock);
|
||||||
|
if (fep->clk_enet_out)
|
||||||
clk_disable_unprepare(fep->clk_enet_out);
|
clk_disable_unprepare(fep->clk_enet_out);
|
||||||
clk_disable_unprepare(fep->clk_ahb);
|
clk_disable_unprepare(fep->clk_ahb);
|
||||||
clk_disable_unprepare(fep->clk_ipg);
|
clk_disable_unprepare(fep->clk_ipg);
|
||||||
@ -2228,6 +2234,7 @@ fec_suspend(struct device *dev)
|
|||||||
fec_stop(ndev);
|
fec_stop(ndev);
|
||||||
netif_device_detach(ndev);
|
netif_device_detach(ndev);
|
||||||
}
|
}
|
||||||
|
if (fep->clk_enet_out)
|
||||||
clk_disable_unprepare(fep->clk_enet_out);
|
clk_disable_unprepare(fep->clk_enet_out);
|
||||||
clk_disable_unprepare(fep->clk_ahb);
|
clk_disable_unprepare(fep->clk_ahb);
|
||||||
clk_disable_unprepare(fep->clk_ipg);
|
clk_disable_unprepare(fep->clk_ipg);
|
||||||
@ -2251,6 +2258,7 @@ fec_resume(struct device *dev)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fep->clk_enet_out)
|
||||||
clk_prepare_enable(fep->clk_enet_out);
|
clk_prepare_enable(fep->clk_enet_out);
|
||||||
clk_prepare_enable(fep->clk_ahb);
|
clk_prepare_enable(fep->clk_ahb);
|
||||||
clk_prepare_enable(fep->clk_ipg);
|
clk_prepare_enable(fep->clk_ipg);
|
||||||
|
Loading…
Reference in New Issue
Block a user