[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240827145525.GK1368797@kernel.org>
Date: Tue, 27 Aug 2024 15:55:25 +0100
From: Simon Horman <horms@...nel.org>
To: Yangtao Li <frank.li@...o.com>
Cc: clement.leger@...tlin.com, andrew@...n.ch, f.fainelli@...il.com,
olteanv@...il.com, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, ulli.kroll@...glemail.com,
linus.walleij@...aro.org, marcin.s.wojtas@...il.com,
linux@...linux.org.uk, alexandre.torgue@...s.st.com,
joabreu@...opsys.com, mcoquelin.stm32@...il.com,
hkallweit1@...il.com, u.kleine-koenig@...gutronix.de,
jacob.e.keller@...el.com, justinstitt@...gle.com,
sd@...asysnail.net, linux-renesas-soc@...r.kernel.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-stm32@...md-mailman.stormreply.com,
Maxime Chevallier <maxime.chevallier@...tlin.com>,
Christophe JAILLET <christophe.jaillet@...adoo.fr>
Subject: Re: [net-next v3 8/9] net: mvpp2: Convert to devm_clk_get_enabled()
and devm_clk_get_optional_enabled()
On Tue, Aug 27, 2024 at 03:57:11AM -0600, Yangtao Li wrote:
> Use devm_clk_get_enabled() and devm_clk_get_optional_enabled()
> to simplify code.
>
> Signed-off-by: Yangtao Li <frank.li@...o.com>
> Reviewed-by: Maxime Chevallier <maxime.chevallier@...tlin.com>
> Tested-by: Maxime Chevallier <maxime.chevallier@...tlin.com>
> Suggested-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> Reviewed-by: Marcin Wojtas <marcin.s.wojtas@...il.com>
...
> diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> index 2fe8bae4eb3c..0ca2daeb0f90 100644
> --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> @@ -7561,56 +7561,32 @@ static int mvpp2_probe(struct platform_device *pdev)
...
> - priv->axi_clk = devm_clk_get_optional(&pdev->dev, "axi_clk");
> - if (IS_ERR(priv->axi_clk)) {
> - err = PTR_ERR(priv->axi_clk);
> - goto err_mg_core_clk;
> + clk = devm_clk_get_optional_enabled(&pdev->dev, "mg_core_clk");
As it looks like there will be a v3 anyway, a minor nit from my side:
IMHO, the line above could be trivially wrapped to keep it <= 80 columns wide,
which is still preferred by Networking code.
> + if (IS_ERR(clk))
> + return PTR_ERR(clk);
> }
>
> - err = clk_prepare_enable(priv->axi_clk);
> - if (err < 0)
> - goto err_mg_core_clk;
> -
> - /* Get system's tclk rate */
> - priv->tclk = clk_get_rate(priv->pp_clk);
> + clk = devm_clk_get_optional_enabled(&pdev->dev, "axi_clk");
> + if (IS_ERR(clk))
> + return PTR_ERR(clk);
...
Powered by blists - more mailing lists