linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] watchdog: Simplify using devm_watchdog_register_device()
@ 2023-03-07  7:04 Uwe Kleine-König
  2023-03-07  7:04 ` [PATCH v2 1/3] watchdog: bcm47xx: " Uwe Kleine-König
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2023-03-07  7:04 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck; +Cc: linux-watchdog, kernel, patches

Hello,

On Mon, Mar 06, 2023 at 12:17:39PM -0800, Guenter Roeck wrote:
> Oops, all those need &pdev->dev as first argument. Please resend with that fixed.

TILA: Don't assume your patch is trivial enough that you can skip the compile
test step. :-\ Sorry.

Here comes a v2 that properly passes a struct device to
devm_watchdog_register_device() and thus compiles fine.

Best regards
Uwe

Uwe Kleine-König (3):
  watchdog: bcm47xx: Simplify using devm_watchdog_register_device()
  watchdog: rn5t618: Simplify using devm_watchdog_register_device()
  watchdog: wm8350: Simplify using devm_watchdog_register_device()

 drivers/watchdog/bcm47xx_wdt.c | 12 +-----------
 drivers/watchdog/rn5t618_wdt.c | 12 +-----------
 drivers/watchdog/wm8350_wdt.c  |  9 +--------
 3 files changed, 3 insertions(+), 30 deletions(-)


base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6
-- 
2.39.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/3] watchdog: bcm47xx: Simplify using devm_watchdog_register_device()
  2023-03-07  7:04 [PATCH v2 0/3] watchdog: Simplify using devm_watchdog_register_device() Uwe Kleine-König
@ 2023-03-07  7:04 ` Uwe Kleine-König
  2023-03-07  7:04 ` [PATCH v2 2/3] watchdog: rn5t618: " Uwe Kleine-König
  2023-03-07  7:04 ` [PATCH v2 3/3] watchdog: wm8350: " Uwe Kleine-König
  2 siblings, 0 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2023-03-07  7:04 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck; +Cc: linux-watchdog, kernel

This allows to drop the .remove() function as it only exists to
unregister the watchdog device which is now done in a callback
registered by devm_watchdog_register_device().

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/watchdog/bcm47xx_wdt.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/watchdog/bcm47xx_wdt.c b/drivers/watchdog/bcm47xx_wdt.c
index 05425c1dfd4c..06a54c7de40b 100644
--- a/drivers/watchdog/bcm47xx_wdt.c
+++ b/drivers/watchdog/bcm47xx_wdt.c
@@ -202,7 +202,7 @@ static int bcm47xx_wdt_probe(struct platform_device *pdev)
 	watchdog_set_restart_priority(&wdt->wdd, 64);
 	watchdog_stop_on_reboot(&wdt->wdd);
 
-	ret = watchdog_register_device(&wdt->wdd);
+	ret = devm_watchdog_register_device(&pdev->dev, &wdt->wdd);
 	if (ret)
 		goto err_timer;
 
@@ -218,21 +218,11 @@ static int bcm47xx_wdt_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int bcm47xx_wdt_remove(struct platform_device *pdev)
-{
-	struct bcm47xx_wdt *wdt = dev_get_platdata(&pdev->dev);
-
-	watchdog_unregister_device(&wdt->wdd);
-
-	return 0;
-}
-
 static struct platform_driver bcm47xx_wdt_driver = {
 	.driver		= {
 		.name	= "bcm47xx-wdt",
 	},
 	.probe		= bcm47xx_wdt_probe,
-	.remove		= bcm47xx_wdt_remove,
 };
 
 module_platform_driver(bcm47xx_wdt_driver);
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 2/3] watchdog: rn5t618: Simplify using devm_watchdog_register_device()
  2023-03-07  7:04 [PATCH v2 0/3] watchdog: Simplify using devm_watchdog_register_device() Uwe Kleine-König
  2023-03-07  7:04 ` [PATCH v2 1/3] watchdog: bcm47xx: " Uwe Kleine-König
@ 2023-03-07  7:04 ` Uwe Kleine-König
  2023-03-07  7:04 ` [PATCH v2 3/3] watchdog: wm8350: " Uwe Kleine-König
  2 siblings, 0 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2023-03-07  7:04 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck; +Cc: linux-watchdog, kernel

This allows to drop the .remove() function as it only exists to
unregister the watchdog device which is now done in a callback
registered by devm_watchdog_register_device().

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/watchdog/rn5t618_wdt.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/watchdog/rn5t618_wdt.c b/drivers/watchdog/rn5t618_wdt.c
index 40d8ebd8c0ac..87d06d210ac9 100644
--- a/drivers/watchdog/rn5t618_wdt.c
+++ b/drivers/watchdog/rn5t618_wdt.c
@@ -178,21 +178,11 @@ static int rn5t618_wdt_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, wdt);
 
-	return watchdog_register_device(&wdt->wdt_dev);
-}
-
-static int rn5t618_wdt_remove(struct platform_device *pdev)
-{
-	struct rn5t618_wdt *wdt = platform_get_drvdata(pdev);
-
-	watchdog_unregister_device(&wdt->wdt_dev);
-
-	return 0;
+	return devm_watchdog_register_device(dev, &wdt->wdt_dev);
 }
 
 static struct platform_driver rn5t618_wdt_driver = {
 	.probe = rn5t618_wdt_probe,
-	.remove = rn5t618_wdt_remove,
 	.driver = {
 		.name	= DRIVER_NAME,
 	},
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 3/3] watchdog: wm8350: Simplify using devm_watchdog_register_device()
  2023-03-07  7:04 [PATCH v2 0/3] watchdog: Simplify using devm_watchdog_register_device() Uwe Kleine-König
  2023-03-07  7:04 ` [PATCH v2 1/3] watchdog: bcm47xx: " Uwe Kleine-König
  2023-03-07  7:04 ` [PATCH v2 2/3] watchdog: rn5t618: " Uwe Kleine-König
@ 2023-03-07  7:04 ` Uwe Kleine-König
  2023-03-07 11:32   ` Charles Keepax
  2 siblings, 1 reply; 5+ messages in thread
From: Uwe Kleine-König @ 2023-03-07  7:04 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck; +Cc: patches, linux-watchdog, kernel

This allows to drop the .remove() function as it only exists to
unregister the watchdog device which is now done in a callback
registered by devm_watchdog_register_device().

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/watchdog/wm8350_wdt.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/watchdog/wm8350_wdt.c b/drivers/watchdog/wm8350_wdt.c
index 33c62d51f00a..c82c1b77d91b 100644
--- a/drivers/watchdog/wm8350_wdt.c
+++ b/drivers/watchdog/wm8350_wdt.c
@@ -153,18 +153,11 @@ static int wm8350_wdt_probe(struct platform_device *pdev)
 	/* Default to 4s timeout */
 	wm8350_wdt_set_timeout(&wm8350_wdt, 4);
 
-	return watchdog_register_device(&wm8350_wdt);
-}
-
-static int wm8350_wdt_remove(struct platform_device *pdev)
-{
-	watchdog_unregister_device(&wm8350_wdt);
-	return 0;
+	return devm_watchdog_register_device(&pdev->dev, &wm8350_wdt);
 }
 
 static struct platform_driver wm8350_wdt_driver = {
 	.probe = wm8350_wdt_probe,
-	.remove = wm8350_wdt_remove,
 	.driver = {
 		.name = "wm8350-wdt",
 	},
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 3/3] watchdog: wm8350: Simplify using devm_watchdog_register_device()
  2023-03-07  7:04 ` [PATCH v2 3/3] watchdog: wm8350: " Uwe Kleine-König
@ 2023-03-07 11:32   ` Charles Keepax
  0 siblings, 0 replies; 5+ messages in thread
From: Charles Keepax @ 2023-03-07 11:32 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Wim Van Sebroeck, Guenter Roeck, patches, linux-watchdog, kernel

On Tue, Mar 07, 2023 at 08:04:04AM +0100, Uwe Kleine-König wrote:
> This allows to drop the .remove() function as it only exists to
> unregister the watchdog device which is now done in a callback
> registered by devm_watchdog_register_device().
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---

Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-03-07 12:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-07  7:04 [PATCH v2 0/3] watchdog: Simplify using devm_watchdog_register_device() Uwe Kleine-König
2023-03-07  7:04 ` [PATCH v2 1/3] watchdog: bcm47xx: " Uwe Kleine-König
2023-03-07  7:04 ` [PATCH v2 2/3] watchdog: rn5t618: " Uwe Kleine-König
2023-03-07  7:04 ` [PATCH v2 3/3] watchdog: wm8350: " Uwe Kleine-König
2023-03-07 11:32   ` Charles Keepax

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).