diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2022-05-20 08:26:50 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-05-22 21:49:21 +0100 |
commit | 5ff851b7be752a6d607c289b489c40f96f9dc489 (patch) | |
tree | 9d40efa683842e3744e694c82d722180e2bcd86e /drivers/net | |
parent | 621427fbdada788f18f77238e1c36f463c2cb9d1 (diff) | |
download | linux-5ff851b7be752a6d607c289b489c40f96f9dc489.tar.bz2 |
net: fec: Do proper error checking for enet_out clk
An error code returned by devm_clk_get() might have other meanings than
"This clock doesn't exist". So use devm_clk_get_optional() and handle
all remaining errors as fatal.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/freescale/fec_main.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 3cb298f1d69c..9d7ef993ce45 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -3866,9 +3866,11 @@ fec_probe(struct platform_device *pdev) fep->itr_clk_rate = clk_get_rate(fep->clk_ahb); /* enet_out is optional, depends on board */ - fep->clk_enet_out = devm_clk_get(&pdev->dev, "enet_out"); - if (IS_ERR(fep->clk_enet_out)) - fep->clk_enet_out = NULL; + fep->clk_enet_out = devm_clk_get_optional(&pdev->dev, "enet_out"); + if (IS_ERR(fep->clk_enet_out)) { + ret = PTR_ERR(fep->clk_enet_out); + goto failed_clk; + } fep->ptp_clk_on = false; mutex_init(&fep->ptp_clk_mutex); |