From: Simon Horman <horms@kernel.org>
To: Yangtao Li <frank.li@vivo.com>
Cc: clement.leger@bootlin.com, andrew@lunn.ch, f.fainelli@gmail.com,
olteanv@gmail.com, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, ulli.kroll@googlemail.com,
linus.walleij@linaro.org, marcin.s.wojtas@gmail.com,
linux@armlinux.org.uk, alexandre.torgue@foss.st.com,
joabreu@synopsys.com, mcoquelin.stm32@gmail.com,
hkallweit1@gmail.com, kees@kernel.org, justinstitt@google.com,
u.kleine-koenig@pengutronix.de, sd@queasysnail.net,
linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-stm32@st-md-mailman.stormreply.com,
Maxime Chevallier <maxime.chevallier@bootlin.com>
Subject: Re: [net-next v2 1/9] net: stmmac: dwmac-intel-plat: Convert to devm_clk_get_enabled()
Date: Tue, 27 Aug 2024 15:48:21 +0100 [thread overview]
Message-ID: <20240827144821.GH1368797@kernel.org> (raw)
In-Reply-To: <20240823072122.2053401-2-frank.li@vivo.com>
On Fri, Aug 23, 2024 at 01:21:13AM -0600, Yangtao Li wrote:
> Convert devm_clk_get(), clk_prepare_enable() to a single
> call to devm_clk_get_enabled(), as this is exactly
> what this function does.
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
> ---
> .../net/ethernet/stmicro/stmmac/dwmac-intel-plat.c | 11 ++---------
> 1 file changed, 2 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c
> index d68f0c4e7835..dcbae653ab8c 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c
> @@ -104,12 +104,10 @@ static int intel_eth_plat_probe(struct platform_device *pdev)
>
> /* Enable TX clock */
> if (dwmac->data->tx_clk_en) {
> - dwmac->tx_clk = devm_clk_get(&pdev->dev, "tx_clk");
> + dwmac->tx_clk = devm_clk_get_enabled(&pdev->dev, "tx_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(dwmac->tx_clk))
> return PTR_ERR(dwmac->tx_clk);
>
> - clk_prepare_enable(dwmac->tx_clk);
> -
> /* Check and configure TX clock rate */
> rate = clk_get_rate(dwmac->tx_clk);
> if (dwmac->data->tx_clk_rate &&
> @@ -149,20 +147,15 @@ static int intel_eth_plat_probe(struct platform_device *pdev)
> }
>
> ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
> - if (ret) {
> - clk_disable_unprepare(dwmac->tx_clk);
> + if (ret)
> return ret;
> - }
>
> return 0;
> }
>
> static void intel_eth_plat_remove(struct platform_device *pdev)
> {
> - struct intel_dwmac *dwmac = get_stmmac_bsp_priv(&pdev->dev);
> -
> stmmac_pltfr_remove(pdev);
> - clk_disable_unprepare(dwmac->tx_clk);
> }
>
> static struct platform_driver intel_eth_plat_driver = {
> --
> 2.39.0
>
next prev parent reply other threads:[~2024-08-27 14:48 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-23 7:21 [net-next v2 0/9] net: convert to devm_clk_get_enabled() and devm_clk_get_optional_enabled() Yangtao Li
2024-08-23 7:21 ` [net-next v2 1/9] net: stmmac: dwmac-intel-plat: Convert to devm_clk_get_enabled() Yangtao Li
2024-08-27 14:48 ` Simon Horman [this message]
2024-08-23 7:21 ` [net-next v2 2/9] net: stmmac: platform: Convert to devm_clk_get_enabled() and devm_clk_get_optional_enabled() Yangtao Li
2024-08-23 9:11 ` Serge Semin
2024-08-23 9:15 ` Biju Das
2024-08-23 9:37 ` Serge Semin
2024-08-23 9:41 ` Biju Das
2024-08-23 7:21 ` [net-next v2 3/9] net: ethernet: cortina: Convert to devm_clk_get_enabled() Yangtao Li
2024-08-26 8:46 ` Linus Walleij
2024-08-26 22:15 ` Jakub Kicinski
2024-08-23 7:21 ` [net-next v2 4/9] net: mdio: hisi-femac: " Yangtao Li
2024-08-23 7:21 ` [net-next v2 5/9] net: dsa: rzn1_a5psw: " Yangtao Li
2024-08-23 7:21 ` [net-next v2 6/9] net: ethernet: broadcom: bcm63xx_enet: " Yangtao Li
2024-08-26 22:15 ` Jakub Kicinski
2024-08-23 7:21 ` [net-next v2 7/9] net: ethernet: marvell: mvneta: " Yangtao Li
2024-08-23 16:54 ` Marcin Wojtas
2024-08-23 7:21 ` [net-next v2 8/9] net: mvpp2: Convert to devm_clk_get_enabled() and devm_clk_get_optional_enabled() Yangtao Li
2024-08-23 16:52 ` Marcin Wojtas
2024-08-23 7:21 ` [net-next v2 9/9] net: marvell: pxa168_eth: Convert to devm_clk_get_enabled() Yangtao Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240827144821.GH1368797@kernel.org \
--to=horms@kernel.org \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew@lunn.ch \
--cc=clement.leger@bootlin.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=frank.li@vivo.com \
--cc=hkallweit1@gmail.com \
--cc=joabreu@synopsys.com \
--cc=justinstitt@google.com \
--cc=kees@kernel.org \
--cc=kuba@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=linux@armlinux.org.uk \
--cc=marcin.s.wojtas@gmail.com \
--cc=maxime.chevallier@bootlin.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=sd@queasysnail.net \
--cc=u.kleine-koenig@pengutronix.de \
--cc=ulli.kroll@googlemail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.