watchdog: mt7621: switch to using managed devm_watchdog_register_device()
"Linux Kernel Mailing List" <[email protected]>
| Newsgroups | gmane.linux.kernel.commits.head |
|---|---|
| Message-ID | <[email protected]> |
Web: https://git.kernel.org/torvalds/c/1d2e5eb521a7edeac9e9decd3d526b04e307bb41 Commit: 1d2e5eb521a7edeac9e9decd3d526b04e307bb41 Parent: 392d39a863583eb6439e2ec543818250b57ef99d Refname: refs/heads/master Author: André Draszik <[email protected]> AuthorDate: Fri Jan 12 09:44:54 2018 +0000 Committer: Wim Van Sebroeck <[email protected]> CommitDate: Sun Jan 21 12:44:59 2018 +0100 watchdog: mt7621: switch to using managed devm_watchdog_register_device() This does the necessary cleanup on driver unload automatically. Signed-off-by: André Draszik <[email protected]> Cc: [email protected] Cc: John Crispin <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]> --- 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 eec57e5e1eae..5c4a764717c4 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); @@ -164,16 +163,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);