Skip to content

Commit 1d2e5eb

Browse files
andredWim Van Sebroeck
authored and
Wim Van Sebroeck
committed
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]>
1 parent 392d39a commit 1d2e5eb

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

drivers/watchdog/mt7621_wdt.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ static struct watchdog_device mt7621_wdt_dev = {
133133
static int mt7621_wdt_probe(struct platform_device *pdev)
134134
{
135135
struct resource *res;
136-
int ret;
137136

138137
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
139138
mt7621_wdt_base = devm_ioremap_resource(&pdev->dev, res);
@@ -164,16 +163,7 @@ static int mt7621_wdt_probe(struct platform_device *pdev)
164163
set_bit(WDOG_HW_RUNNING, &mt7621_wdt_dev.status);
165164
}
166165

167-
ret = watchdog_register_device(&mt7621_wdt_dev);
168-
169-
return 0;
170-
}
171-
172-
static int mt7621_wdt_remove(struct platform_device *pdev)
173-
{
174-
watchdog_unregister_device(&mt7621_wdt_dev);
175-
176-
return 0;
166+
return devm_watchdog_register_device(&pdev->dev, &mt7621_wdt_dev);
177167
}
178168

179169
static void mt7621_wdt_shutdown(struct platform_device *pdev)
@@ -189,7 +179,6 @@ MODULE_DEVICE_TABLE(of, mt7621_wdt_match);
189179

190180
static struct platform_driver mt7621_wdt_driver = {
191181
.probe = mt7621_wdt_probe,
192-
.remove = mt7621_wdt_remove,
193182
.shutdown = mt7621_wdt_shutdown,
194183
.driver = {
195184
.name = KBUILD_MODNAME,

0 commit comments

Comments
 (0)