From f676449785d333078acb60ccf2046d0d3c59548f Mon Sep 17 00:00:00 2001 From: Wim Van Sebroeck Date: Sun, 30 Jul 2006 20:06:07 +0200 Subject: [PATCH] [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 --- drivers/char/watchdog/pnx4008_wdt.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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; } -- 2.20.1