From: Wim Van Sebroeck Date: Sun, 30 Jul 2006 18:06:07 +0000 (+0200) Subject: [WATCHDOG] pnx4008_wdt.c - remove patch X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=f676449785d333078acb60ccf2046d0d3c59548f;p=openwrt%2Fstaging%2Fblogic.git [WATCHDOG] pnx4008_wdt.c - remove patch Change remove code so that we first detach the driver from userspace, then clean up the clock and then clean up the memory we allocated. Signed-off-by: Wim Van Sebroeck --- diff --git a/drivers/char/watchdog/pnx4008_wdt.c b/drivers/char/watchdog/pnx4008_wdt.c index d36a169c1b86..465dfd3ba61a 100644 --- a/drivers/char/watchdog/pnx4008_wdt.c +++ b/drivers/char/watchdog/pnx4008_wdt.c @@ -297,17 +297,17 @@ out: static int pnx4008_wdt_remove(struct platform_device *pdev) { - if (wdt_mem) { - release_resource(wdt_mem); - kfree(wdt_mem); - wdt_mem = NULL; - } + misc_deregister(&pnx4008_wdt_miscdev); if (wdt_clk) { clk_set_rate(wdt_clk, 0); clk_put(wdt_clk); wdt_clk = NULL; } - misc_deregister(&pnx4008_wdt_miscdev); + if (wdt_mem) { + release_resource(wdt_mem); + kfree(wdt_mem); + wdt_mem = NULL; + } return 0; }