From: Guenter Roeck <linux@roeck-us.net>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>,
linux-watchdog@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [PATCH 23/34] watchdog: rdc321x: Convert to platform remove callback returning void
Date: Sat, 4 Mar 2023 09:10:28 -0800 [thread overview]
Message-ID: <7ad7b710-7edf-4752-8674-f052b531809d@roeck-us.net> (raw)
In-Reply-To: <20230303213716.2123717-24-u.kleine-koenig@pengutronix.de>
On Fri, Mar 03, 2023 at 10:37:05PM +0100, Uwe Kleine-König wrote:
> 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 (mostly) ignored
> 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.
>
> 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>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/watchdog/rdc321x_wdt.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/watchdog/rdc321x_wdt.c b/drivers/watchdog/rdc321x_wdt.c
> index f0c94ea51c3e..6176f4343fc5 100644
> --- a/drivers/watchdog/rdc321x_wdt.c
> +++ b/drivers/watchdog/rdc321x_wdt.c
> @@ -257,7 +257,7 @@ static int rdc321x_wdt_probe(struct platform_device *pdev)
> return 0;
> }
>
> -static int rdc321x_wdt_remove(struct platform_device *pdev)
> +static void rdc321x_wdt_remove(struct platform_device *pdev)
> {
> if (rdc321x_wdt_device.queue) {
> rdc321x_wdt_device.queue = 0;
> @@ -265,13 +265,11 @@ static int rdc321x_wdt_remove(struct platform_device *pdev)
> }
>
> misc_deregister(&rdc321x_wdt_misc);
> -
> - return 0;
> }
>
> static struct platform_driver rdc321x_wdt_driver = {
> .probe = rdc321x_wdt_probe,
> - .remove = rdc321x_wdt_remove,
> + .remove_new = rdc321x_wdt_remove,
> .driver = {
> .name = "rdc321x-wdt",
> },
> --
> 2.39.1
>
next prev parent reply other threads:[~2023-03-04 17:10 UTC|newest]
Thread overview: 74+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-03 21:36 [PATCH 00/34] watchdog: Convert to platform remove callback returning void Uwe Kleine-König
2023-03-03 21:36 ` [PATCH 01/34] watchdog: s3c2410: Don't skip cleanup in remove's error path Uwe Kleine-König
2023-03-04 16:58 ` Guenter Roeck
2023-03-03 21:36 ` [PATCH 02/34] watchdog: acquirewdt: Convert to platform remove callback returning void Uwe Kleine-König
2023-03-04 17:02 ` Guenter Roeck
2023-03-03 21:36 ` [PATCH 03/34] watchdog: advantechwdt: " Uwe Kleine-König
2023-03-04 17:02 ` Guenter Roeck
2023-03-03 21:36 ` [PATCH 04/34] watchdog: ar7: " Uwe Kleine-König
2023-03-04 17:02 ` Guenter Roeck
2023-03-03 21:36 ` [PATCH 05/34] watchdog: at91rm9200: " Uwe Kleine-König
2023-03-04 17:02 ` Guenter Roeck
2023-03-06 11:55 ` Claudiu.Beznea
2023-03-03 21:36 ` [PATCH 06/34] watchdog: ath79: " Uwe Kleine-König
2023-03-04 17:02 ` Guenter Roeck
2023-03-03 21:36 ` [PATCH 07/34] watchdog: bcm2835: " Uwe Kleine-König
2023-03-03 21:38 ` Florian Fainelli
2023-03-04 17:04 ` Guenter Roeck
2023-03-03 21:36 ` [PATCH 08/34] watchdog: bcm47xx: " Uwe Kleine-König
2023-03-04 17:01 ` Guenter Roeck
2023-03-03 21:36 ` [PATCH 09/34] watchdog: bcm_kona: " Uwe Kleine-König
2023-03-03 21:39 ` Florian Fainelli
2023-03-04 17:05 ` Guenter Roeck
2023-03-03 21:36 ` [PATCH 10/34] watchdog: cpwd: " Uwe Kleine-König
2023-03-04 17:05 ` Guenter Roeck
2023-03-03 21:36 ` [PATCH 11/34] watchdog: dw: " Uwe Kleine-König
2023-03-04 17:06 ` Guenter Roeck
2023-03-03 21:36 ` [PATCH 12/34] watchdog: gef: " Uwe Kleine-König
2023-03-04 17:06 ` Guenter Roeck
2023-03-03 21:36 ` [PATCH 13/34] watchdog: geodewdt: " Uwe Kleine-König
2023-03-04 17:07 ` Guenter Roeck
2023-03-03 21:36 ` [PATCH 14/34] watchdog: ib700wdt: " Uwe Kleine-König
2023-03-04 17:07 ` Guenter Roeck
2023-03-03 21:36 ` [PATCH 15/34] watchdog: ie6xx: " Uwe Kleine-König
2023-03-04 17:07 ` Guenter Roeck
2023-03-03 21:36 ` [PATCH 16/34] watchdog: lpc18xx: " Uwe Kleine-König
2023-03-04 17:08 ` Guenter Roeck
2023-03-03 21:36 ` [PATCH 17/34] watchdog: mtx-1: " Uwe Kleine-König
2023-03-04 17:09 ` Guenter Roeck
2023-03-03 21:37 ` [PATCH 18/34] watchdog: nic7018: " Uwe Kleine-König
2023-03-04 17:09 ` Guenter Roeck
2023-03-03 21:37 ` [PATCH 19/34] watchdog: nv_tco: " Uwe Kleine-König
2023-03-04 17:09 ` Guenter Roeck
2023-03-03 21:37 ` [PATCH 20/34] watchdog: omap: " Uwe Kleine-König
2023-03-04 17:09 ` Guenter Roeck
2023-03-03 21:37 ` [PATCH 21/34] watchdog: orion: " Uwe Kleine-König
2023-03-04 17:10 ` Guenter Roeck
2023-03-03 21:37 ` [PATCH 22/34] watchdog: rc32434: " Uwe Kleine-König
2023-03-04 17:10 ` Guenter Roeck
2023-03-03 21:37 ` [PATCH 23/34] watchdog: rdc321x: " Uwe Kleine-König
2023-03-04 17:10 ` Guenter Roeck [this message]
2023-03-03 21:37 ` [PATCH 24/34] watchdog: renesas: " Uwe Kleine-König
2023-03-04 17:10 ` Guenter Roeck
2023-03-03 21:37 ` [PATCH 25/34] watchdog: riowd: " Uwe Kleine-König
2023-03-04 17:10 ` Guenter Roeck
2023-03-03 21:37 ` [PATCH 26/34] watchdog: rn5t618: " Uwe Kleine-König
2023-03-04 17:12 ` Guenter Roeck
2023-03-03 21:37 ` [PATCH 27/34] watchdog: rti: " Uwe Kleine-König
2023-03-04 17:12 ` Guenter Roeck
2023-03-03 21:37 ` [PATCH 28/34] watchdog: s3c2410: " Uwe Kleine-König
2023-03-04 17:12 ` Guenter Roeck
2023-03-03 21:37 ` [PATCH 29/34] watchdog: sa1100: " Uwe Kleine-König
2023-03-04 17:13 ` Guenter Roeck
2023-03-03 21:37 ` [PATCH 30/34] watchdog: sch311x: " Uwe Kleine-König
2023-03-04 17:13 ` Guenter Roeck
2023-03-03 21:37 ` [PATCH 31/34] watchdog: shwdt: " Uwe Kleine-König
2023-03-04 17:13 ` Guenter Roeck
2023-03-03 21:37 ` [PATCH 32/34] watchdog: st_lpc: " Uwe Kleine-König
2023-03-04 17:13 ` Guenter Roeck
2023-03-03 21:37 ` [PATCH 33/34] watchdog: stmp3xxx_rtc: " Uwe Kleine-König
2023-03-04 17:14 ` Guenter Roeck
2023-03-03 21:37 ` [PATCH 34/34] watchdog: wm8350: " Uwe Kleine-König
2023-03-04 17:14 ` Guenter Roeck
2023-03-06 17:05 ` [PATCH 00/34] watchdog: " Uwe Kleine-König
2023-03-14 8:38 ` Naresh Kamboju
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=7ad7b710-7edf-4752-8674-f052b531809d@roeck-us.net \
--to=linux@roeck-us.net \
--cc=kernel@pengutronix.de \
--cc=linux-watchdog@vger.kernel.org \
--cc=u.kleine-koenig@pengutronix.de \
--cc=wim@linux-watchdog.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).