netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: fec: Do proper error checking for enet_out clk
@ 2022-03-25 16:55 Uwe Kleine-König
  2022-03-28 23:09 ` Jakub Kicinski
  0 siblings, 1 reply; 3+ messages in thread
From: Uwe Kleine-König @ 2022-03-25 16:55 UTC (permalink / raw)
  To: Joakim Zhang, David S. Miller, Jakub Kicinski
  Cc: netdev, kernel, NXP Linux Team

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>
---
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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: fec: Do proper error checking for enet_out clk
  2022-03-25 16:55 [PATCH net-next] net: fec: Do proper error checking for enet_out clk Uwe Kleine-König
@ 2022-03-28 23:09 ` Jakub Kicinski
  2022-03-29  5:47   ` Uwe Kleine-König
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Kicinski @ 2022-03-28 23:09 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Joakim Zhang, David S. Miller, netdev, kernel, NXP Linux Team

On Fri, 25 Mar 2022 17:55:43 +0100 Uwe Kleine-König wrote:
> 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>
> ---
> 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.

Would you mind reposting after the merge window? 
We keep net-next closed until -rc1 is cut.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: fec: Do proper error checking for enet_out clk
  2022-03-28 23:09 ` Jakub Kicinski
@ 2022-03-29  5:47   ` Uwe Kleine-König
  0 siblings, 0 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2022-03-29  5:47 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: netdev, NXP Linux Team, Joakim Zhang, kernel, David S. Miller

[-- Attachment #1: Type: text/plain, Size: 844 bytes --]

On Mon, Mar 28, 2022 at 04:09:10PM -0700, Jakub Kicinski wrote:
> On Fri, 25 Mar 2022 17:55:43 +0100 Uwe Kleine-König wrote:
> > 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>
> > ---
> > 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.
> 
> Would you mind reposting after the merge window? 
> We keep net-next closed until -rc1 is cut.

I somehow expected there is an implicit queue of patches that is
processed once net-next opens again. But sure, will resend after -rc1.

Best regards
Uwe

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-29  5:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-25 16:55 [PATCH net-next] net: fec: Do proper error checking for enet_out clk Uwe Kleine-König
2022-03-28 23:09 ` Jakub Kicinski
2022-03-29  5:47   ` Uwe Kleine-König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).