aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorWim Van Sebroeck <wim@iguana.be>2010-05-21 08:11:42 +0000
committerWim Van Sebroeck <wim@iguana.be>2010-08-08 18:20:09 +0000
commit9a3725631331f279fa44b6522874ce8818bcc455 (patch)
treed6d28e9c718c379847a2bf79b3fdaaaa2286c33c /drivers
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')
-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 300932580de..ae53662c29b 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)
static int __devexit s3c2410wdt_remove(struct platform_device *dev)
{
- s3c2410wdt_cpufreq_deregister();
-
- release_resource(wdt_mem);
- kfree(wdt_mem);
- wdt_mem = NULL;
+ misc_deregister(&s3c2410wdt_miscdev);
- free_irq(wdt_irq->start, dev);
- wdt_irq = NULL;
+ s3c2410wdt_cpufreq_deregister();
clk_disable(wdt_clock);
clk_put(wdt_clock);
wdt_clock = NULL;
+ free_irq(wdt_irq->start, dev);
+ wdt_irq = NULL;
+
iounmap(wdt_base);
- misc_deregister(&s3c2410wdt_miscdev);
+
+ release_resource(wdt_mem);
+ kfree(wdt_mem);
+ wdt_mem = NULL;
return 0;
}