]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - kernel/watchdog.c
watchdog: Fix sysctl consistency
[karo-tx-linux.git] / kernel / watchdog.c
index e7f81f8bc43e0914331657be2e34827b229af899..93e61c55b7fa7ecfcabcdc426bf29bd219f84c0d 100644 (file)
@@ -441,9 +441,6 @@ static int watchdog_enable(int cpu)
                wake_up_process(p);
        }
 
-       /* if any cpu succeeds, watchdog is considered enabled for the system */
-       watchdog_enabled = 1;
-
        return 0;
 }
 
@@ -471,12 +468,16 @@ static void watchdog_disable(int cpu)
 static void watchdog_enable_all_cpus(void)
 {
        int cpu;
-       int result = 0;
+
+       watchdog_enabled = 0;
 
        for_each_online_cpu(cpu)
-               result += watchdog_enable(cpu);
+               if (!watchdog_enable(cpu))
+                       /* if any cpu succeeds, watchdog is considered
+                          enabled for the system */
+                       watchdog_enabled = 1;
 
-       if (result)
+       if (!watchdog_enabled)
                printk(KERN_ERR "watchdog: failed to be enabled on some cpus\n");
 
 }