linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "André Draszik" <git@andred.net>
To: linux-kernel@vger.kernel.org
Cc: Wim Van Sebroeck <wim@iguana.be>,
	Guenter Roeck <linux@roeck-us.net>,
	linux-watchdog@vger.kernel.org, John Crispin <john@phrozen.org>
Subject: [PATCH 2/2] watchdog: mt7621: switch to using managed devm_watchdog_register_device()
Date: Wed, 10 Jan 2018 12:13:23 +0000	[thread overview]
Message-ID: <20180110121323.17657-2-git@andred.net> (raw)
In-Reply-To: <20180110121323.17657-1-git@andred.net>

This does the necessary cleanup on driver unload automatically.

Signed-off-by: André Draszik <git@andred.net>
Cc: Wim Van Sebroeck <wim@iguana.be>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-watchdog@vger.kernel.org
Cc: John Crispin <john@phrozen.org>
---
 drivers/watchdog/mt7621_wdt.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/watchdog/mt7621_wdt.c b/drivers/watchdog/mt7621_wdt.c
index 0eabea2d88a2..a04f49309188 100644
--- a/drivers/watchdog/mt7621_wdt.c
+++ b/drivers/watchdog/mt7621_wdt.c
@@ -133,7 +133,6 @@ static struct watchdog_device mt7621_wdt_dev = {
 static int mt7621_wdt_probe(struct platform_device *pdev)
 {
 	struct resource *res;
-	int ret;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	mt7621_wdt_base = devm_ioremap_resource(&pdev->dev, res);
@@ -161,16 +160,7 @@ static int mt7621_wdt_probe(struct platform_device *pdev)
 		set_bit(WDOG_HW_RUNNING, &mt7621_wdt_dev.status);
 	}
 
-	ret = watchdog_register_device(&mt7621_wdt_dev);
-
-	return 0;
-}
-
-static int mt7621_wdt_remove(struct platform_device *pdev)
-{
-	watchdog_unregister_device(&mt7621_wdt_dev);
-
-	return 0;
+	return devm_watchdog_register_device(&pdev->dev, &mt7621_wdt_dev);
 }
 
 static void mt7621_wdt_shutdown(struct platform_device *pdev)
@@ -186,7 +176,6 @@ MODULE_DEVICE_TABLE(of, mt7621_wdt_match);
 
 static struct platform_driver mt7621_wdt_driver = {
 	.probe		= mt7621_wdt_probe,
-	.remove		= mt7621_wdt_remove,
 	.shutdown	= mt7621_wdt_shutdown,
 	.driver		= {
 		.name		= KBUILD_MODNAME,
-- 
2.15.1


  reply	other threads:[~2018-01-10 12:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-10 12:13 [PATCH 1/2] watchdog: mt7621: Set WDOG_HW_RUNNING, when watchdog is already running André Draszik
2018-01-10 12:13 ` André Draszik [this message]
2018-01-11 18:25   ` [PATCH 2/2] watchdog: mt7621: switch to using managed devm_watchdog_register_device() Guenter Roeck
2018-01-11 18:24 ` [PATCH 1/2] watchdog: mt7621: Set WDOG_HW_RUNNING, when watchdog is already running Guenter Roeck
2018-01-12  9:44 ` [PATCH v2 1/2] watchdog: mt7621: set WDOG_HW_RUNNING bit when appropriate André Draszik
2018-01-12  9:44   ` [PATCH v2 2/2] watchdog: mt7621: switch to using managed devm_watchdog_register_device() André Draszik
2018-01-12 23:22   ` [PATCH v2 1/2] watchdog: mt7621: set WDOG_HW_RUNNING bit when appropriate Guenter Roeck

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=20180110121323.17657-2-git@andred.net \
    --to=git@andred.net \
    --cc=john@phrozen.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=wim@iguana.be \
    /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).