aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorWim Van Sebroeck <wim@iguana.be>2010-05-21 04:11:42 -0400
committerWim Van Sebroeck <wim@iguana.be>2010-08-08 14:20:09 -0400
commit9a3725631331f279fa44b6522874ce8818bcc455 (patch)
treed6d28e9c718c379847a2bf79b3fdaaaa2286c33c /drivers/watchdog
parent2d53056973079e6c2ffc0d7ae3afbdd3d4f18ae3 (diff)
watchdog: s3c2410_wdt - Fix removing of platform device
When removing the watchdog platform device, we need to disable the access to userspace first. It makes no sense to remove the drivers clock, irq's, ... and then disable userspace access. the order of removal has also been changed so that it is the reverse of probing (this way the clock is also disabled sooner). Cc: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/s3c2410_wdt.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
index 300932580ded..ae53662c29bc 100644
--- a/drivers/watchdog/s3c2410_wdt.c
+++ b/drivers/watchdog/s3c2410_wdt.c
@@ -532,21 +532,22 @@ static int __devinit s3c2410wdt_probe(struct platform_device *pdev)
532 532
533static int __devexit s3c2410wdt_remove(struct platform_device *dev) 533static int __devexit s3c2410wdt_remove(struct platform_device *dev)
534{ 534{
535 s3c2410wdt_cpufreq_deregister(); 535 misc_deregister(&s3c2410wdt_miscdev);
536
537 release_resource(wdt_mem);
538 kfree(wdt_mem);
539 wdt_mem = NULL;
540 536
541 free_irq(wdt_irq->start, dev); 537 s3c2410wdt_cpufreq_deregister();
542 wdt_irq = NULL;
543 538
544 clk_disable(wdt_clock); 539 clk_disable(wdt_clock);
545 clk_put(wdt_clock); 540 clk_put(wdt_clock);
546 wdt_clock = NULL; 541 wdt_clock = NULL;
547 542
543 free_irq(wdt_irq->start, dev);
544 wdt_irq = NULL;
545
548 iounmap(wdt_base); 546 iounmap(wdt_base);
549 misc_deregister(&s3c2410wdt_miscdev); 547
548 release_resource(wdt_mem);
549 kfree(wdt_mem);
550 wdt_mem = NULL;
550 return 0; 551 return 0;
551} 552}
552 553