[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yof3/o46wXWXMsKo@lunn.ch>
Date: Fri, 20 May 2022 22:20:14 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>
Cc: Joakim Zhang <qiangqing.zhang@....com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org,
NXP Linux Team <linux-imx@....com>, kernel@...gutronix.de
Subject: Re: [PATCH net-next RESEND] net: fec: Do proper error checking for
enet_out clk
> diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
> index 11227f51404c..2512b68d8545 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);
Reviewed-by: Andrew Lunn <andrew@...n.ch>
This is O.K, as far as it goes. But directly after this we have:
/* clk_ref is optional, depends on board */
fep->clk_ref = devm_clk_get(&pdev->dev, "enet_clk_ref");
if (IS_ERR(fep->clk_ref))
fep->clk_ref = NULL;
fep->clk_ref_rate = clk_get_rate(fep->clk_ref);
It would be good to do the same to this clock as well.
Andrew
Powered by blists - more mailing lists