lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Thu, 11 Jan 2018 10:25:54 -0800 From: Guenter Roeck <linux@...ck-us.net> To: André Draszik <git@...red.net> Cc: linux-kernel@...r.kernel.org, Wim Van Sebroeck <wim@...ana.be>, linux-watchdog@...r.kernel.org, John Crispin <john@...ozen.org> Subject: Re: [PATCH 2/2] watchdog: mt7621: switch to using managed devm_watchdog_register_device() On Wed, Jan 10, 2018 at 12:13:23PM +0000, André Draszik wrote: > This does the necessary cleanup on driver unload automatically. > > Signed-off-by: André Draszik <git@...red.net> > Cc: Wim Van Sebroeck <wim@...ana.be> > Cc: Guenter Roeck <linux@...ck-us.net> > Cc: linux-watchdog@...r.kernel.org > Cc: John Crispin <john@...ozen.org> Reviewed-by: Guenter Roeck <linux@...ck-us.net> > --- > 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 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in > the body of a message to majordomo@...r.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists