[WATCHDOG] pnx4008_wdt.c - remove patch
authorWim Van Sebroeck <wim@iguana.be>
Sun, 30 Jul 2006 18:06:07 +0000 (20:06 +0200)
committerWim Van Sebroeck <wim@iguana.be>
Mon, 2 Oct 2006 21:05:16 +0000 (23:05 +0200)
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 <wim@iguana.be>
drivers/char/watchdog/pnx4008_wdt.c

index d36a169c1b86723d421f0f00c8e14fd42988221b..465dfd3ba61ac3fb6e90379da135a168d7516fa3 100644 (file)
@@ -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;
 }