From: Larysa Zaremba <larysa.zaremba@intel.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Jose Abreu <joabreu@synopsys.com>, <netdev@vger.kernel.org>,
<linux-stm32@st-md-mailman.stormreply.com>,
<linux-arm-kernel@lists.infradead.org>, <kernel@pengutronix.de>
Subject: Re: [PATCH 1/2] net: stmmac: Make stmmac_dvr_remove() return void
Date: Mon, 13 Feb 2023 15:21:27 +0100 [thread overview]
Message-ID: <Y+pHZ75Ynp5xkgQy@lincoln> (raw)
In-Reply-To: <20230211112431.214252-1-u.kleine-koenig@pengutronix.de>
On Sat, Feb 11, 2023 at 12:24:30PM +0100, Uwe Kleine-König wrote:
> The function returns zero unconditionally. Change it to return void instead
> which simplifies some callers as error handing becomes unnecessary.
>
> This also makes it more obvious that most platform remove callbacks always
> return zero.
Code in both patches looks OK.
Please, specify, which tree this patch should be in (net or net-next).
This is rather a code improvement than a fix, so net-next would be appropriate.
Also, multiple patches usually require a cover letter. The code changes are
trivial, so maybe the best solution would be to just to squash those patches
together.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c | 4 +---
> drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 5 +++--
> drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 5 +++--
> drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c | 5 +++--
> drivers/net/ethernet/stmicro/stmmac/stmmac.h | 2 +-
> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +---
> drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 5 +++--
> 7 files changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
> index 80efdeeb0b59..87a2c1a18638 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
> @@ -477,9 +477,7 @@ static int dwc_eth_dwmac_remove(struct platform_device *pdev)
>
> data = device_get_match_data(&pdev->dev);
>
> - err = stmmac_dvr_remove(&pdev->dev);
> - if (err < 0)
> - dev_err(&pdev->dev, "failed to remove platform: %d\n", err);
> + stmmac_dvr_remove(&pdev->dev);
>
> err = data->remove(pdev);
> if (err < 0)
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
> index 6656d76b6766..4b8fd11563e4 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
> @@ -1915,11 +1915,12 @@ static int rk_gmac_probe(struct platform_device *pdev)
> static int rk_gmac_remove(struct platform_device *pdev)
> {
> struct rk_priv_data *bsp_priv = get_stmmac_bsp_priv(&pdev->dev);
> - int ret = stmmac_dvr_remove(&pdev->dev);
> +
> + stmmac_dvr_remove(&pdev->dev);
>
> rk_gmac_powerdown(bsp_priv);
>
> - return ret;
> + return 0;
> }
>
> #ifdef CONFIG_PM_SLEEP
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c
> index 710d7435733e..be3b1ebc06ab 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c
> @@ -371,11 +371,12 @@ static int sti_dwmac_probe(struct platform_device *pdev)
> static int sti_dwmac_remove(struct platform_device *pdev)
> {
> struct sti_dwmac *dwmac = get_stmmac_bsp_priv(&pdev->dev);
> - int ret = stmmac_dvr_remove(&pdev->dev);
> +
> + stmmac_dvr_remove(&pdev->dev);
>
> clk_disable_unprepare(dwmac->clk);
>
> - return ret;
> + return 0;
> }
>
> #ifdef CONFIG_PM_SLEEP
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
> index 2b38a499a404..0616b3a04ff3 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
> @@ -421,9 +421,10 @@ static int stm32_dwmac_remove(struct platform_device *pdev)
> {
> struct net_device *ndev = platform_get_drvdata(pdev);
> struct stmmac_priv *priv = netdev_priv(ndev);
> - int ret = stmmac_dvr_remove(&pdev->dev);
> struct stm32_dwmac *dwmac = priv->plat->bsp_priv;
>
> + stmmac_dvr_remove(&pdev->dev);
> +
> stm32_dwmac_clk_disable(priv->plat->bsp_priv);
>
> if (dwmac->irq_pwr_wakeup >= 0) {
> @@ -431,7 +432,7 @@ static int stm32_dwmac_remove(struct platform_device *pdev)
> device_init_wakeup(&pdev->dev, false);
> }
>
> - return ret;
> + return 0;
> }
>
> static int stm32mp1_suspend(struct stm32_dwmac *dwmac)
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
> index bdbf86cb102a..3d15e1e92e18 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
> @@ -345,7 +345,7 @@ int stmmac_xdp_open(struct net_device *dev);
> void stmmac_xdp_release(struct net_device *dev);
> int stmmac_resume(struct device *dev);
> int stmmac_suspend(struct device *dev);
> -int stmmac_dvr_remove(struct device *dev);
> +void stmmac_dvr_remove(struct device *dev);
> int stmmac_dvr_probe(struct device *device,
> struct plat_stmmacenet_data *plat_dat,
> struct stmmac_resources *res);
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index c6951c976f5d..97bcfb628463 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -7341,7 +7341,7 @@ EXPORT_SYMBOL_GPL(stmmac_dvr_probe);
> * Description: this function resets the TX/RX processes, disables the MAC RX/TX
> * changes the link status, releases the DMA descriptor rings.
> */
> -int stmmac_dvr_remove(struct device *dev)
> +void stmmac_dvr_remove(struct device *dev)
> {
> struct net_device *ndev = dev_get_drvdata(dev);
> struct stmmac_priv *priv = netdev_priv(ndev);
> @@ -7377,8 +7377,6 @@ int stmmac_dvr_remove(struct device *dev)
>
> pm_runtime_disable(dev);
> pm_runtime_put_noidle(dev);
> -
> - return 0;
> }
> EXPORT_SYMBOL_GPL(stmmac_dvr_remove);
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> index eb6d9cd8e93f..5429531ae7c7 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> @@ -711,14 +711,15 @@ int stmmac_pltfr_remove(struct platform_device *pdev)
> struct net_device *ndev = platform_get_drvdata(pdev);
> struct stmmac_priv *priv = netdev_priv(ndev);
> struct plat_stmmacenet_data *plat = priv->plat;
> - int ret = stmmac_dvr_remove(&pdev->dev);
> +
> + stmmac_dvr_remove(&pdev->dev);
>
> if (plat->exit)
> plat->exit(pdev, plat->bsp_priv);
>
> stmmac_remove_config_dt(pdev, plat);
>
> - return ret;
> + return 0;
> }
> EXPORT_SYMBOL_GPL(stmmac_pltfr_remove);
>
>
> base-commit: 1b929c02afd37871d5afb9d498426f83432e71c2
> --
> 2.39.0
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-02-13 14:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-11 11:24 [PATCH 1/2] net: stmmac: Make stmmac_dvr_remove() return void Uwe Kleine-König
2023-02-11 11:24 ` [PATCH 2/2] net: stmmac: dwc-qos: Make struct dwc_eth_dwmac_data::remove " Uwe Kleine-König
2023-02-13 14:21 ` Larysa Zaremba [this message]
2023-02-13 16:23 ` [PATCH 1/2] net: stmmac: Make stmmac_dvr_remove() " Uwe Kleine-König
2023-02-14 1:36 ` Jakub Kicinski
2023-02-14 4:10 ` patchwork-bot+netdevbpf
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=Y+pHZ75Ynp5xkgQy@lincoln \
--to=larysa.zaremba@intel.com \
--cc=alexandre.torgue@foss.st.com \
--cc=joabreu@synopsys.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=netdev@vger.kernel.org \
--cc=peppe.cavallaro@st.com \
--cc=u.kleine-koenig@pengutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox