Skip to content

Commit

Permalink
watchdog: s3c2410_wdt - Fix removing of platform device
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wim Van Sebroeck committed Aug 8, 2010
1 parent 2d53056 commit 9a37256
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions drivers/watchdog/s3c2410_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 9a37256

Please sign in to comment.