[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220325165543.33963-1-u.kleine-koenig@pengutronix.de>
Date: Fri, 25 Mar 2022 17:55:43 +0100
From: Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>
To: Joakim Zhang <qiangqing.zhang@....com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>
Cc: netdev@...r.kernel.org, kernel@...gutronix.de,
NXP Linux Team <linux-imx@....com>
Subject: [PATCH net-next] 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@...gutronix.de>
---
Hello,
this isn't urgent and doesn't fix a problem I encountered, just noticed
this patch opportunity while looking up something different in the
driver.
Best regards
Uwe
drivers/net/ethernet/freescale/fec_main.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 796133de527e..b0500ecd4ee8 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);
--
2.35.1
Powered by blists - more mailing lists