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 18/34] watchdog: nic7018: Convert to platform remove callback returning void
Date: Sat, 4 Mar 2023 09:09:17 -0800 [thread overview]
Message-ID: <f7484d63-e351-4256-a1a1-2bc099feeea2@roeck-us.net> (raw)
In-Reply-To: <20230303213716.2123717-19-u.kleine-koenig@pengutronix.de>
On Fri, Mar 03, 2023 at 10:37:00PM +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/nic7018_wdt.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/watchdog/nic7018_wdt.c b/drivers/watchdog/nic7018_wdt.c
> index 2a46cc662943..c3f0a4926667 100644
> --- a/drivers/watchdog/nic7018_wdt.c
> +++ b/drivers/watchdog/nic7018_wdt.c
> @@ -218,7 +218,7 @@ static int nic7018_probe(struct platform_device *pdev)
> return 0;
> }
>
> -static int nic7018_remove(struct platform_device *pdev)
> +static void nic7018_remove(struct platform_device *pdev)
> {
> struct nic7018_wdt *wdt = platform_get_drvdata(pdev);
>
> @@ -226,8 +226,6 @@ static int nic7018_remove(struct platform_device *pdev)
>
> /* Lock WDT register */
> outb(LOCK, wdt->io_base + WDT_REG_LOCK);
> -
> - return 0;
> }
>
> static const struct acpi_device_id nic7018_device_ids[] = {
> @@ -238,7 +236,7 @@ MODULE_DEVICE_TABLE(acpi, nic7018_device_ids);
>
> static struct platform_driver watchdog_driver = {
> .probe = nic7018_probe,
> - .remove = nic7018_remove,
> + .remove_new = nic7018_remove,
> .driver = {
> .name = KBUILD_MODNAME,
> .acpi_match_table = ACPI_PTR(nic7018_device_ids),
> --
> 2.39.1
>
next prev parent reply other threads:[~2023-03-04 17:09 UTC|newest]
Thread overview: 92+ 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 ` 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-03 21:36 ` Uwe Kleine-König
2023-03-04 16:58 ` Guenter Roeck
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-03 21:36 ` Uwe Kleine-König
2023-03-04 17:02 ` Guenter Roeck
2023-03-04 17:02 ` Guenter Roeck
2023-03-06 11:55 ` Claudiu.Beznea
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:36 ` Uwe Kleine-König
2023-03-03 21:38 ` Florian Fainelli
2023-03-03 21:38 ` Florian Fainelli
2023-03-04 17:04 ` Guenter Roeck
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-03 21:36 ` Uwe Kleine-König
2023-03-04 17:08 ` Guenter Roeck
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 [this message]
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
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-03 21:37 ` Uwe Kleine-König
2023-03-04 17:12 ` Guenter Roeck
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-03 21:37 ` Uwe Kleine-König
2023-03-04 17:13 ` Guenter Roeck
2023-03-04 17:13 ` Guenter Roeck
2023-03-03 21:37 ` [PATCH 33/34] watchdog: stmp3xxx_rtc: " Uwe Kleine-König
2023-03-03 21:37 ` Uwe Kleine-König
2023-03-04 17:14 ` Guenter Roeck
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-06 17:05 ` 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=f7484d63-e351-4256-a1a1-2bc099feeea2@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 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.