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>,
Vladimir Zapolskiy <vz@mleia.com>,
linux-watchdog@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de
Subject: Re: [PATCH 16/34] watchdog: lpc18xx: Convert to platform remove callback returning void
Date: Sat, 4 Mar 2023 09:08:50 -0800 [thread overview]
Message-ID: <c03b73df-fa61-40ef-893a-20a25fc8c80d@roeck-us.net> (raw)
In-Reply-To: <20230303213716.2123717-17-u.kleine-koenig@pengutronix.de>
On Fri, Mar 03, 2023 at 10:36:58PM +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/lpc18xx_wdt.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/watchdog/lpc18xx_wdt.c b/drivers/watchdog/lpc18xx_wdt.c
> index 1b9b5f21a0df..19535f4a2fd2 100644
> --- a/drivers/watchdog/lpc18xx_wdt.c
> +++ b/drivers/watchdog/lpc18xx_wdt.c
> @@ -261,14 +261,12 @@ static int lpc18xx_wdt_probe(struct platform_device *pdev)
> return devm_watchdog_register_device(dev, &lpc18xx_wdt->wdt_dev);
> }
>
> -static int lpc18xx_wdt_remove(struct platform_device *pdev)
> +static void lpc18xx_wdt_remove(struct platform_device *pdev)
> {
> struct lpc18xx_wdt_dev *lpc18xx_wdt = platform_get_drvdata(pdev);
>
> dev_warn(&pdev->dev, "I quit now, hardware will probably reboot!\n");
> del_timer_sync(&lpc18xx_wdt->timer);
> -
> - return 0;
> }
>
> static const struct of_device_id lpc18xx_wdt_match[] = {
> @@ -283,7 +281,7 @@ static struct platform_driver lpc18xx_wdt_driver = {
> .of_match_table = lpc18xx_wdt_match,
> },
> .probe = lpc18xx_wdt_probe,
> - .remove = lpc18xx_wdt_remove,
> + .remove_new = lpc18xx_wdt_remove,
> };
> module_platform_driver(lpc18xx_wdt_driver);
>
> --
> 2.39.1
>
next prev parent reply other threads:[~2023-03-04 17:08 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 [this message]
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
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=c03b73df-fa61-40ef-893a-20a25fc8c80d@roeck-us.net \
--to=linux@roeck-us.net \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=u.kleine-koenig@pengutronix.de \
--cc=vz@mleia.com \
--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).