From: "Jernej Škrabec" <jernej.skrabec@gmail.com>
To: "David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Chen-Yu Tsai <wens@csie.org>,
Samuel Holland <samuel@sholland.org>,
netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-sunxi@lists.linux.dev, kernel@pengutronix.de
Subject: Re: [PATCH net-next 04/54] net: ethernet: allwinner: Convert to platform remove callback returning void
Date: Tue, 19 Sep 2023 19:22:31 +0200 [thread overview]
Message-ID: <3254669.aeNJFYEL58@jernej-laptop> (raw)
In-Reply-To: <20230918204227.1316886-5-u.kleine-koenig@pengutronix.de>
Dne ponedeljek, 18. september 2023 ob 22:41:36 CEST je Uwe Kleine-König
napisal(a):
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is ignored (apart
> from emitting a warning) and this typically results in resource leaks.
> To improve here there is a quest to make the remove callback return
> void. In the first step of this quest all drivers are converted to
> .remove_new() which already returns void. Eventually after all drivers
> are converted, .remove_new() is renamed to .remove().
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Best regards,
Jernej
> ---
> drivers/net/ethernet/allwinner/sun4i-emac.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c
> b/drivers/net/ethernet/allwinner/sun4i-emac.c index
> a94c62956eed..d761c08fe5c1 100644
> --- a/drivers/net/ethernet/allwinner/sun4i-emac.c
> +++ b/drivers/net/ethernet/allwinner/sun4i-emac.c
> @@ -1083,7 +1083,7 @@ static int emac_probe(struct platform_device *pdev)
> return ret;
> }
>
> -static int emac_remove(struct platform_device *pdev)
> +static void emac_remove(struct platform_device *pdev)
> {
> struct net_device *ndev = platform_get_drvdata(pdev);
> struct emac_board_info *db = netdev_priv(ndev);
> @@ -1101,7 +1101,6 @@ static int emac_remove(struct platform_device *pdev)
> free_netdev(ndev);
>
> dev_dbg(&pdev->dev, "released and freed device\n");
> - return 0;
> }
>
> static int emac_suspend(struct platform_device *dev, pm_message_t state)
> @@ -1143,7 +1142,7 @@ static struct platform_driver emac_driver = {
> .of_match_table = emac_of_match,
> },
> .probe = emac_probe,
> - .remove = emac_remove,
> + .remove_new = emac_remove,
> .suspend = emac_suspend,
> .resume = emac_resume,
> };
next prev parent reply other threads:[~2023-09-19 17:22 UTC|newest]
Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-18 20:41 [PATCH net-next 00/54] net: ethernet: Convert to platform remove callback returning void Uwe Kleine-König
2023-09-18 20:41 ` [PATCH net-next 01/54] net: ethernet: 8390: " Uwe Kleine-König
2023-09-18 20:41 ` [PATCH net-next 02/54] net: ethernet: actions: " Uwe Kleine-König
2023-09-18 20:41 ` [PATCH net-next 03/54] net: ethernet: aeroflex: " Uwe Kleine-König
2023-09-18 20:41 ` [PATCH net-next 04/54] net: ethernet: allwinner: " Uwe Kleine-König
2023-09-19 17:22 ` Jernej Škrabec [this message]
2023-09-18 20:41 ` [PATCH net-next 05/54] net: ethernet: altera: " Uwe Kleine-König
2023-09-18 20:41 ` [PATCH net-next 06/54] net: ethernet: amd: " Uwe Kleine-König
2023-09-18 20:41 ` [PATCH net-next 07/54] net: ethernet: apm: " Uwe Kleine-König
2023-09-18 20:41 ` [PATCH net-next 08/54] net: ethernet: apple: " Uwe Kleine-König
2023-09-18 20:41 ` [PATCH net-next 09/54] net: ethernet: arc: " Uwe Kleine-König
2023-09-18 20:41 ` [PATCH net-next 10/54] net: ethernet: atheros: " Uwe Kleine-König
2023-09-18 20:41 ` [PATCH net-next 11/54] net: ethernet: broadcom: " Uwe Kleine-König
2023-09-18 20:55 ` Florian Fainelli
2023-09-18 20:41 ` [PATCH net-next 12/54] net: ethernet: cadence: " Uwe Kleine-König
2023-09-19 6:00 ` claudiu beznea
2023-09-18 20:41 ` [PATCH net-next 13/54] net: ethernet: calxeda: " Uwe Kleine-König
2023-09-18 20:41 ` [PATCH net-next 14/54] net: ethernet: cavium: " Uwe Kleine-König
2023-09-18 20:41 ` [PATCH net-next 15/54] net: ethernet: cirrus: " Uwe Kleine-König
2023-09-18 20:41 ` [PATCH net-next 16/54] net: ethernet: cortina: " Uwe Kleine-König
2023-09-18 20:41 ` [PATCH net-next 17/54] net: ethernet: davicom: " Uwe Kleine-König
2023-09-18 20:41 ` [PATCH net-next 18/54] net: ethernet: dnet: " Uwe Kleine-König
2023-09-18 20:41 ` [PATCH net-next 19/54] net: ethernet: engleder: " Uwe Kleine-König
2023-09-18 20:41 ` [PATCH net-next 20/54] net: ethernet: ethoc: " Uwe Kleine-König
2023-09-18 20:41 ` [PATCH net-next 21/54] net: ethernet: faraday: " Uwe Kleine-König
2023-09-18 20:41 ` [PATCH net-next 22/54] net: ethernet: hisilicon: " Uwe Kleine-König
2023-09-18 20:41 ` [PATCH net-next 23/54] net: ethernet: i825xx: " Uwe Kleine-König
2023-09-18 20:41 ` [PATCH net-next 24/54] net: ethernet: ibm: " Uwe Kleine-König
2023-09-18 20:41 ` [PATCH net-next 25/54] net: ethernet: korina: " Uwe Kleine-König
2023-09-18 20:41 ` [PATCH net-next 26/54] net: ethernet: lantiq_etop: " Uwe Kleine-König
2023-09-18 20:41 ` [PATCH net-next 27/54] net: ethernet: lantiq_xrx200: " Uwe Kleine-König
2023-09-18 20:42 ` [PATCH net-next 28/54] net: ethernet: litex: " Uwe Kleine-König
2023-09-18 20:54 ` Gabriel L. Somlo
2023-09-18 20:42 ` [PATCH net-next 29/54] net: ethernet: marvell: " Uwe Kleine-König
2023-09-18 20:42 ` [PATCH net-next 30/54] net: ethernet: mediatek: " Uwe Kleine-König
2023-09-18 20:42 ` [PATCH net-next 31/54] net: ethernet: mellanox: " Uwe Kleine-König
2023-09-19 8:21 ` Leon Romanovsky
2023-09-18 20:42 ` [PATCH net-next 32/54] net: ethernet: micrel: " Uwe Kleine-König
2023-09-18 20:42 ` [PATCH net-next 33/54] net: ethernet: microchip: " Uwe Kleine-König
2023-09-18 20:42 ` [PATCH net-next 34/54] net: ethernet: moxa:: " Uwe Kleine-König
2023-09-18 20:42 ` [PATCH net-next 35/54] net: ethernet: mscc: " Uwe Kleine-König
2023-09-18 20:42 ` [PATCH net-next 36/54] net: ethernet: natsemi: " Uwe Kleine-König
2023-09-18 20:42 ` [PATCH net-next 37/54] " Uwe Kleine-König
2023-09-18 20:42 ` [PATCH net-next 38/54] net: ethernet: ni: " Uwe Kleine-König
2023-09-18 20:42 ` [PATCH net-next 39/54] net: ethernet: nxp: " Uwe Kleine-König
2023-09-18 20:42 ` [PATCH net-next 40/54] net: ethernet: qualcomm: " Uwe Kleine-König
2023-09-19 0:29 ` Timur Tabi
2023-09-18 20:42 ` [PATCH net-next 41/54] net: ethernet: renesas: " Uwe Kleine-König
2023-09-19 6:58 ` Geert Uytterhoeven
2023-09-19 17:28 ` Sergey Shtylyov
2023-09-20 0:02 ` Yoshihiro Shimoda
2023-09-18 20:42 ` [PATCH net-next 42/54] net: ethernet: samsung: " Uwe Kleine-König
2023-09-18 20:42 ` [PATCH net-next 43/54] net: ethernet: seeq: " Uwe Kleine-König
2023-09-18 20:42 ` [PATCH net-next 44/54] net: ethernet: sgi: " Uwe Kleine-König
2023-09-18 20:42 ` [PATCH net-next 45/54] net: ethernet: smsc: " Uwe Kleine-König
2023-09-18 20:42 ` [PATCH net-next 46/54] net: ethernet: socionext: " Uwe Kleine-König
2023-09-18 20:42 ` [PATCH net-next 47/54] net: ethernet: sun: " Uwe Kleine-König
2023-09-18 20:42 ` [PATCH net-next 48/54] net: ethernet: sunplus: " Uwe Kleine-König
2023-09-18 20:42 ` [PATCH net-next 49/54] net: ethernet: ti: " Uwe Kleine-König
2023-09-18 20:54 ` Florian Fainelli
2023-09-18 20:42 ` [PATCH net-next 50/54] net: ethernet: tundra: " Uwe Kleine-König
2023-09-18 20:42 ` [PATCH net-next 51/54] net: ethernet: via: " Uwe Kleine-König
2023-09-18 20:42 ` [PATCH net-next 52/54] net: ethernet: wiznet: " Uwe Kleine-König
2023-09-18 20:42 ` [PATCH net-next 53/54] net: ethernet: xilinx: " Uwe Kleine-König
2023-09-19 4:45 ` Pandey, Radhey Shyam
2023-09-19 8:33 ` Uwe Kleine-König
2023-09-18 20:42 ` [PATCH net-next 54/54] net: ethernet: xscale: " Uwe Kleine-König
2023-09-20 7:52 ` Krzysztof Hałasa
2023-09-20 9:20 ` Linus Walleij
2023-09-20 8:10 ` [PATCH net-next 00/54] net: ethernet: " 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=3254669.aeNJFYEL58@jernej-laptop \
--to=jernej.skrabec@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=samuel@sholland.org \
--cc=u.kleine-koenig@pengutronix.de \
--cc=wens@csie.org \
/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;
as well as URLs for NNTP newsgroup(s).