diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2013-03-18 08:33:39 +0100 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2013-04-04 15:22:39 +0200 |
commit | c29dc2d771411850777eb027756b12106b5f6cd5 (patch) | |
tree | b81711c934f84e4066e1a9dcd3eebd56e6b847ee /drivers/net/ethernet/freescale | |
parent | clocksource: mxs_timer: Add semicolon at end of line (diff) | |
download | linux-c29dc2d771411850777eb027756b12106b5f6cd5.tar.xz linux-c29dc2d771411850777eb027756b12106b5f6cd5.zip |
net: fec: handle optional clk_ptp more gracefully
When the optional clk_ptp is absent, we can just set it to NULL, and
clk API will just handle it gracefully. It saves us from checking
clk_ptp whenever calling into clk API.
Also since clk_ptp is optional, the "ret" variable shouldn't be set
in case that the clock is absent.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/freescale')
-rw-r--r-- | drivers/net/ethernet/freescale/fec.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c index 911d0253dbb2..6d965bb32908 100644 --- a/drivers/net/ethernet/freescale/fec.c +++ b/drivers/net/ethernet/freescale/fec.c @@ -1806,14 +1806,13 @@ fec_probe(struct platform_device *pdev) fep->bufdesc_ex = pdev->id_entry->driver_data & FEC_QUIRK_HAS_BUFDESC_EX; if (IS_ERR(fep->clk_ptp)) { - ret = PTR_ERR(fep->clk_ptp); + fep->clk_ptp = NULL; fep->bufdesc_ex = 0; } clk_prepare_enable(fep->clk_ahb); clk_prepare_enable(fep->clk_ipg); - if (!IS_ERR(fep->clk_ptp)) - clk_prepare_enable(fep->clk_ptp); + clk_prepare_enable(fep->clk_ptp); reg_phy = devm_regulator_get(&pdev->dev, "phy"); if (!IS_ERR(reg_phy)) { @@ -1878,8 +1877,7 @@ failed_irq: failed_regulator: clk_disable_unprepare(fep->clk_ahb); clk_disable_unprepare(fep->clk_ipg); - if (!IS_ERR(fep->clk_ptp)) - clk_disable_unprepare(fep->clk_ptp); + clk_disable_unprepare(fep->clk_ptp); failed_pin: failed_clk: iounmap(fep->hwp); |