watchdog: wafer5823wdt: Fix handling WDIOS_DISABLECARD/WDIOS_ENABLECARD options
authorAxel Lin <axel.lin@gmail.com>
Wed, 18 Jan 2012 11:26:43 +0000 (19:26 +0800)
committerWim Van Sebroeck <wim@iguana.be>
Fri, 27 Jan 2012 08:55:13 +0000 (09:55 +0100)
While receiving WDIOS_DISABLECARD option for WDIOC_SETOPTIONS command,
call wafwdt_stop() to disable watchdog.
Call wafwdt_start() while receiving WDIOS_ENABLECARD option.

Current code has reverse behavior.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
drivers/watchdog/wafer5823wdt.c

index 42e940c238914172e199d5e232369ccc33ccf35e..c3c3188c34d744312cf8e1dbe3e2c30426e87248 100644 (file)
@@ -152,12 +152,12 @@ static long wafwdt_ioctl(struct file *file, unsigned int cmd,
                        return -EFAULT;
 
                if (options & WDIOS_DISABLECARD) {
-                       wafwdt_start();
+                       wafwdt_stop();
                        retval = 0;
                }
 
                if (options & WDIOS_ENABLECARD) {
-                       wafwdt_stop();
+                       wafwdt_start();
                        retval = 0;
                }