[WATCHDOG] Coding style - Indentation - part 2
Wim Van Sebroeck [Fri, 18 Jul 2008 11:41:17 +0000 (11:41 +0000)]
This brings the watchdog drivers into line with coding style.
This patch takes cares of the indentation as described in chapter 1.
Main changes:
* Re-structure the ioctl switch call for all drivers as follows:
switch (cmd) {
case WDIOC_GETSUPPORT:
case WDIOC_GETSTATUS:
case WDIOC_GETBOOTSTATUS:
case WDIOC_GETTEMP:
case WDIOC_SETOPTIONS:
case WDIOC_KEEPALIVE:
case WDIOC_SETTIMEOUT:
case WDIOC_GETTIMEOUT:
case WDIOC_GETTIMELEFT:
default:
}

This to make the migration from the drivers to the uniform watchdog
device driver easier in the future.

Signed-off-by: Wim Van Sebroeck <wim@iguana.be>

54 files changed:
drivers/watchdog/acquirewdt.c
drivers/watchdog/advantechwdt.c
drivers/watchdog/alim1535_wdt.c
drivers/watchdog/alim7101_wdt.c
drivers/watchdog/ar7_wdt.c
drivers/watchdog/at32ap700x_wdt.c
drivers/watchdog/at91rm9200_wdt.c
drivers/watchdog/bfin_wdt.c
drivers/watchdog/booke_wdt.c
drivers/watchdog/cpu5wdt.c
drivers/watchdog/davinci_wdt.c
drivers/watchdog/ep93xx_wdt.c
drivers/watchdog/eurotechwdt.c
drivers/watchdog/geodewdt.c
drivers/watchdog/i6300esb.c
drivers/watchdog/iTCO_wdt.c
drivers/watchdog/ib700wdt.c
drivers/watchdog/ibmasr.c
drivers/watchdog/indydog.c
drivers/watchdog/iop_wdt.c
drivers/watchdog/it8712f_wdt.c
drivers/watchdog/ixp2000_wdt.c
drivers/watchdog/ixp4xx_wdt.c
drivers/watchdog/ks8695_wdt.c
drivers/watchdog/mixcomwd.c
drivers/watchdog/mpcore_wdt.c
drivers/watchdog/mtx-1_wdt.c
drivers/watchdog/omap_wdt.c
drivers/watchdog/pc87413_wdt.c
drivers/watchdog/pcwd.c
drivers/watchdog/pcwd_pci.c
drivers/watchdog/pcwd_usb.c
drivers/watchdog/pnx4008_wdt.c
drivers/watchdog/s3c2410_wdt.c
drivers/watchdog/sa1100_wdt.c
drivers/watchdog/sb_wdog.c
drivers/watchdog/sbc60xxwdt.c
drivers/watchdog/sbc7240_wdt.c
drivers/watchdog/sbc_epx_c3.c
drivers/watchdog/sc1200wdt.c
drivers/watchdog/sc520_wdt.c
drivers/watchdog/scx200_wdt.c
drivers/watchdog/shwdt.c
drivers/watchdog/smsc37b787_wdt.c
drivers/watchdog/softdog.c
drivers/watchdog/txx9wdt.c
drivers/watchdog/w83627hf_wdt.c
drivers/watchdog/w83697hf_wdt.c
drivers/watchdog/w83877f_wdt.c
drivers/watchdog/w83977f_wdt.c
drivers/watchdog/wafer5823wdt.c
drivers/watchdog/wdt.c
drivers/watchdog/wdt977.c
drivers/watchdog/wdt_pci.c

index 340d1ee..7a5c694 100644 (file)
@@ -164,13 +164,6 @@ static long acq_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, p);
 
-       case WDIOC_KEEPALIVE:
-               acq_keepalive();
-               return 0;
-
-       case WDIOC_GETTIMEOUT:
-               return put_user(WATCHDOG_HEARTBEAT, p);
-
        case WDIOC_SETOPTIONS:
        {
                if (get_user(options, p))
@@ -185,6 +178,13 @@ static long acq_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                }
                return retval;
        }
+       case WDIOC_KEEPALIVE:
+               acq_keepalive();
+               return 0;
+
+       case WDIOC_GETTIMEOUT:
+               return put_user(WATCHDOG_HEARTBEAT, p);
+
        default:
                return -ENOTTY;
        }
index e6bf8d2..bfec166 100644 (file)
@@ -152,19 +152,6 @@ static long advwdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, p);
 
-       case WDIOC_KEEPALIVE:
-               advwdt_ping();
-               break;
-
-       case WDIOC_SETTIMEOUT:
-               if (get_user(new_timeout, p))
-                       return -EFAULT;
-               if (advwdt_set_heartbeat(new_timeout))
-                       return -EINVAL;
-               advwdt_ping();
-               /* Fall */
-       case WDIOC_GETTIMEOUT:
-               return put_user(timeout, p);
        case WDIOC_SETOPTIONS:
        {
                int options, retval = -EINVAL;
@@ -181,6 +168,19 @@ static long advwdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                }
                return retval;
        }
+       case WDIOC_KEEPALIVE:
+               advwdt_ping();
+               break;
+
+       case WDIOC_SETTIMEOUT:
+               if (get_user(new_timeout, p))
+                       return -EFAULT;
+               if (advwdt_set_heartbeat(new_timeout))
+                       return -EINVAL;
+               advwdt_ping();
+               /* Fall */
+       case WDIOC_GETTIMEOUT:
+               return put_user(timeout, p);
        default:
                return -ENOTTY;
        }
index 80e323d..dfa11d1 100644 (file)
@@ -195,9 +195,6 @@ static long ali_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        case WDIOC_GETSTATUS:
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, p);
-       case WDIOC_KEEPALIVE:
-               ali_keepalive();
-               return 0;
        case WDIOC_SETOPTIONS:
        {
                int new_options, retval = -EINVAL;
@@ -214,6 +211,9 @@ static long ali_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                }
                return retval;
        }
+       case WDIOC_KEEPALIVE:
+               ali_keepalive();
+               return 0;
        case WDIOC_SETTIMEOUT:
        {
                int new_timeout;
index 726e75d..049c912 100644 (file)
@@ -251,9 +251,6 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        case WDIOC_GETSTATUS:
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, p);
-       case WDIOC_KEEPALIVE:
-               wdt_keepalive();
-               return 0;
        case WDIOC_SETOPTIONS:
        {
                int new_options, retval = -EINVAL;
@@ -270,6 +267,9 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                }
                return retval;
        }
+       case WDIOC_KEEPALIVE:
+               wdt_keepalive();
+               return 0;
        case WDIOC_SETTIMEOUT:
        {
                int new_timeout;
index ef7b0d6..9a81a20 100644 (file)
@@ -251,8 +251,6 @@ static long ar7_wdt_ioctl(struct file *file,
        int new_margin;
 
        switch (cmd) {
-       default:
-               return -ENOTTY;
        case WDIOC_GETSUPPORT:
                if (copy_to_user((struct watchdog_info *)arg, &ident,
                                sizeof(ident)))
@@ -281,6 +279,8 @@ static long ar7_wdt_ioctl(struct file *file,
                if (put_user(margin, (int *)arg))
                        return -EFAULT;
                return 0;
+       default:
+               return -ENOTTY;
        }
 }
 
index c5dc5e9..4538b57 100644 (file)
@@ -221,27 +221,10 @@ static long at32_wdt_ioctl(struct file *file,
        int __user *p = argp;
 
        switch (cmd) {
-       case WDIOC_KEEPALIVE:
-               at32_wdt_pat();
-               ret = 0;
-               break;
        case WDIOC_GETSUPPORT:
                ret = copy_to_user(argp, &at32_wdt_info,
                                sizeof(at32_wdt_info)) ? -EFAULT : 0;
                break;
-       case WDIOC_SETTIMEOUT:
-               ret = get_user(time, p);
-               if (ret)
-                       break;
-               ret = at32_wdt_settimeout(time);
-               if (ret)
-                       break;
-               /* Enable new time value */
-               at32_wdt_start();
-               /* fall through */
-       case WDIOC_GETTIMEOUT:
-               ret = put_user(wdt->timeout, p);
-               break;
        case WDIOC_GETSTATUS:
                ret = put_user(0, p);
                break;
@@ -258,6 +241,23 @@ static long at32_wdt_ioctl(struct file *file,
                        at32_wdt_start();
                ret = 0;
                break;
+       case WDIOC_KEEPALIVE:
+               at32_wdt_pat();
+               ret = 0;
+               break;
+       case WDIOC_SETTIMEOUT:
+               ret = get_user(time, p);
+               if (ret)
+                       break;
+               ret = at32_wdt_settimeout(time);
+               if (ret)
+                       break;
+               /* Enable new time value */
+               at32_wdt_start();
+               /* fall through */
+       case WDIOC_GETTIMEOUT:
+               ret = put_user(wdt->timeout, p);
+               break;
        }
 
        return ret;
index bb79f64..2313f44 100644 (file)
@@ -137,23 +137,9 @@ static long at91_wdt_ioct(struct file *file,
        int new_value;
 
        switch (cmd) {
-       case WDIOC_KEEPALIVE:
-               at91_wdt_reload();      /* pat the watchdog */
-               return 0;
        case WDIOC_GETSUPPORT:
                return copy_to_user(argp, &at91_wdt_info,
                                sizeof(at91_wdt_info)) ? -EFAULT : 0;
-       case WDIOC_SETTIMEOUT:
-               if (get_user(new_value, p))
-                       return -EFAULT;
-               if (at91_wdt_settimeout(new_value))
-                       return -EINVAL;
-               /* Enable new time value */
-               at91_wdt_start();
-               /* Return current value */
-               return put_user(wdt_time, p);
-       case WDIOC_GETTIMEOUT:
-               return put_user(wdt_time, p);
        case WDIOC_GETSTATUS:
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, p);
@@ -165,6 +151,20 @@ static long at91_wdt_ioct(struct file *file,
                if (new_value & WDIOS_ENABLECARD)
                        at91_wdt_start();
                return 0;
+       case WDIOC_KEEPALIVE:
+               at91_wdt_reload();      /* pat the watchdog */
+               return 0;
+       case WDIOC_SETTIMEOUT:
+               if (get_user(new_value, p))
+                       return -EFAULT;
+               if (at91_wdt_settimeout(new_value))
+                       return -EINVAL;
+               /* Enable new time value */
+               at91_wdt_start();
+               /* Return current value */
+               return put_user(wdt_time, p);
+       case WDIOC_GETTIMEOUT:
+               return put_user(wdt_time, p);
        default:
                return -ENOTTY;
        }
index 8f6e871..31b4225 100644 (file)
@@ -265,20 +265,6 @@ static long bfin_wdt_ioctl(struct file *file,
        case WDIOC_GETSTATUS:
        case WDIOC_GETBOOTSTATUS:
                return put_user(!!(_bfin_swrst & SWRST_RESET_WDOG), p);
-       case WDIOC_KEEPALIVE:
-               bfin_wdt_keepalive();
-               return 0;
-       case WDIOC_SETTIMEOUT: {
-               int new_timeout;
-
-               if (get_user(new_timeout, p))
-                       return -EFAULT;
-               if (bfin_wdt_set_timeout(new_timeout))
-                       return -EINVAL;
-       }
-       /* Fall */
-       case WDIOC_GETTIMEOUT:
-               return put_user(timeout, p);
        case WDIOC_SETOPTIONS: {
                unsigned long flags;
                int options, ret = -EINVAL;
@@ -298,6 +284,20 @@ static long bfin_wdt_ioctl(struct file *file,
                spin_unlock_irqrestore(&bfin_wdt_spinlock, flags);
                return ret;
        }
+       case WDIOC_KEEPALIVE:
+               bfin_wdt_keepalive();
+               return 0;
+       case WDIOC_SETTIMEOUT: {
+               int new_timeout;
+
+               if (get_user(new_timeout, p))
+                       return -EFAULT;
+               if (bfin_wdt_set_timeout(new_timeout))
+                       return -EINVAL;
+       }
+       /* Fall */
+       case WDIOC_GETTIMEOUT:
+               return put_user(timeout, p);
        default:
                return -ENOTTY;
        }
index 06b7a17..c3b78a7 100644 (file)
@@ -99,6 +99,15 @@ static long booke_wdt_ioctl(struct file *file,
                tmp = mfspr(SPRN_TSR) & TSR_WRS(3);
                /* returns 1 if last reset was caused by the WDT */
                return (tmp ? 1 : 0);
+       case WDIOC_SETOPTIONS:
+               if (get_user(tmp, p))
+                       return -EINVAL;
+               if (tmp == WDIOS_ENABLECARD) {
+                       booke_wdt_ping();
+                       break;
+               } else
+                       return -EINVAL;
+               return 0;
        case WDIOC_KEEPALIVE:
                booke_wdt_ping();
                return 0;
@@ -110,15 +119,6 @@ static long booke_wdt_ioctl(struct file *file,
                return 0;
        case WDIOC_GETTIMEOUT:
                return put_user(booke_wdt_period, p);
-       case WDIOC_SETOPTIONS:
-               if (get_user(tmp, p))
-                       return -EINVAL;
-               if (tmp == WDIOS_ENABLECARD) {
-                       booke_wdt_ping();
-                       break;
-               } else
-                       return -EINVAL;
-               return 0;
        default:
                return -ENOTTY;
        }
index ec324e5..71f6d7e 100644 (file)
@@ -160,8 +160,9 @@ static long cpu5wdt_ioctl(struct file *file, unsigned int cmd,
        };
 
        switch (cmd) {
-       case WDIOC_KEEPALIVE:
-               cpu5wdt_reset();
+       case WDIOC_GETSUPPORT:
+               if (copy_to_user(argp, &ident, sizeof(ident)))
+                       return -EFAULT;
                break;
        case WDIOC_GETSTATUS:
                value = inb(port + CPU5WDT_STATUS_REG);
@@ -169,10 +170,6 @@ static long cpu5wdt_ioctl(struct file *file, unsigned int cmd,
                return put_user(value, p);
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, p);
-       case WDIOC_GETSUPPORT:
-               if (copy_to_user(argp, &ident, sizeof(ident)))
-                       return -EFAULT;
-               break;
        case WDIOC_SETOPTIONS:
                if (get_user(value, p))
                        return -EFAULT;
@@ -181,6 +178,9 @@ static long cpu5wdt_ioctl(struct file *file, unsigned int cmd,
                if (value & WDIOS_DISABLECARD)
                        cpu5wdt_stop();
                break;
+       case WDIOC_KEEPALIVE:
+               cpu5wdt_reset();
+               break;
        default:
                return -ENOTTY;
        }
index 926b59c..802aeba 100644 (file)
@@ -159,14 +159,14 @@ static long davinci_wdt_ioctl(struct file *file,
                ret = put_user(0, (int *)arg);
                break;
 
-       case WDIOC_GETTIMEOUT:
-               ret = put_user(heartbeat, (int *)arg);
-               break;
-
        case WDIOC_KEEPALIVE:
                wdt_service();
                ret = 0;
                break;
+
+       case WDIOC_GETTIMEOUT:
+               ret = put_user(heartbeat, (int *)arg);
+               break;
        }
        return ret;
 }
index cdcdd11..07b74a7 100644 (file)
@@ -155,15 +155,15 @@ static long ep93xx_wdt_ioctl(struct file *file,
                ret = put_user(boot_status, (int __user *)arg);
                break;
 
-       case WDIOC_GETTIMEOUT:
-               /* actually, it is 0.250 seconds.... */
-               ret = put_user(1, (int __user *)arg);
-               break;
-
        case WDIOC_KEEPALIVE:
                wdt_keepalive();
                ret = 0;
                break;
+
+       case WDIOC_GETTIMEOUT:
+               /* actually, it is 0.250 seconds.... */
+               ret = put_user(1, (int __user *)arg);
+               break;
        }
        return ret;
 }
index b94e6ef..9625011 100644 (file)
@@ -249,9 +249,6 @@ static long eurwdt_ioctl(struct file *file,
        int options, retval = -EINVAL;
 
        switch (cmd) {
-       default:
-               return -ENOTTY;
-
        case WDIOC_GETSUPPORT:
                return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
 
@@ -259,6 +256,22 @@ static long eurwdt_ioctl(struct file *file,
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, p);
 
+       case WDIOC_SETOPTIONS:
+               if (get_user(options, p))
+                       return -EFAULT;
+               spin_lock(&eurwdt_lock);
+               if (options & WDIOS_DISABLECARD) {
+                       eurwdt_disable_timer();
+                       retval = 0;
+               }
+               if (options & WDIOS_ENABLECARD) {
+                       eurwdt_activate_timer();
+                       eurwdt_ping();
+                       retval = 0;
+               }
+               spin_unlock(&eurwdt_lock);
+               return retval;
+
        case WDIOC_KEEPALIVE:
                spin_lock(&eurwdt_lock);
                eurwdt_ping();
@@ -282,21 +295,8 @@ static long eurwdt_ioctl(struct file *file,
        case WDIOC_GETTIMEOUT:
                return put_user(eurwdt_timeout, p);
 
-       case WDIOC_SETOPTIONS:
-               if (get_user(options, p))
-                       return -EFAULT;
-               spin_lock(&eurwdt_lock);
-               if (options & WDIOS_DISABLECARD) {
-                       eurwdt_disable_timer();
-                       retval = 0;
-               }
-               if (options & WDIOS_ENABLECARD) {
-                       eurwdt_activate_timer();
-                       eurwdt_ping();
-                       retval = 0;
-               }
-               spin_unlock(&eurwdt_lock);
-               return retval;
+       default:
+               return -ENOTTY;
        }
 }
 
index 74c0069..04b861c 100644 (file)
@@ -159,22 +159,6 @@ geodewdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, p);
 
-       case WDIOC_KEEPALIVE:
-               geodewdt_ping();
-               return 0;
-
-       case WDIOC_SETTIMEOUT:
-               if (get_user(interval, p))
-                       return -EFAULT;
-
-               if (geodewdt_set_heartbeat(interval))
-                       return -EINVAL;
-
-/* Fall through */
-
-       case WDIOC_GETTIMEOUT:
-               return put_user(timeout, p);
-
        case WDIOC_SETOPTIONS:
        {
                int options, ret = -EINVAL;
@@ -194,6 +178,20 @@ geodewdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 
                return ret;
        }
+       case WDIOC_KEEPALIVE:
+               geodewdt_ping();
+               return 0;
+
+       case WDIOC_SETTIMEOUT:
+               if (get_user(interval, p))
+                       return -EFAULT;
+
+               if (geodewdt_set_heartbeat(interval))
+                       return -EINVAL;
+       /* Fall through */
+       case WDIOC_GETTIMEOUT:
+               return put_user(timeout, p);
+
        default:
                return -ENOTTY;
        }
index 01a283f..c768cb7 100644 (file)
@@ -280,10 +280,6 @@ static long esb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        case WDIOC_GETBOOTSTATUS:
                return put_user(triggered, p);
 
-       case WDIOC_KEEPALIVE:
-               esb_timer_keepalive();
-               return 0;
-
        case WDIOC_SETOPTIONS:
        {
                if (get_user(new_options, p))
@@ -301,6 +297,10 @@ static long esb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                }
                return retval;
        }
+       case WDIOC_KEEPALIVE:
+               esb_timer_keepalive();
+               return 0;
+
        case WDIOC_SETTIMEOUT:
        {
                if (get_user(new_heartbeat, p))
index c9ca8f6..b187664 100644 (file)
@@ -532,10 +532,6 @@ static long iTCO_wdt_ioctl(struct file *file, unsigned int cmd,
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, p);
 
-       case WDIOC_KEEPALIVE:
-               iTCO_wdt_keepalive();
-               return 0;
-
        case WDIOC_SETOPTIONS:
        {
                if (get_user(new_options, p))
@@ -552,6 +548,10 @@ static long iTCO_wdt_ioctl(struct file *file, unsigned int cmd,
                }
                return retval;
        }
+       case WDIOC_KEEPALIVE:
+               iTCO_wdt_keepalive();
+               return 0;
+
        case WDIOC_SETTIMEOUT:
        {
                if (get_user(new_heartbeat, p))
index 9eb9537..6aa914e 100644 (file)
@@ -213,21 +213,6 @@ static long ibwdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, p);
 
-       case WDIOC_KEEPALIVE:
-               ibwdt_ping();
-               break;
-
-       case WDIOC_SETTIMEOUT:
-               if (get_user(new_margin, p))
-                       return -EFAULT;
-               if (ibwdt_set_heartbeat(new_margin))
-                       return -EINVAL;
-               ibwdt_ping();
-               /* Fall */
-
-       case WDIOC_GETTIMEOUT:
-               return put_user(wd_times[wd_margin], p);
-
        case WDIOC_SETOPTIONS:
        {
                int options, retval = -EINVAL;
@@ -245,6 +230,21 @@ static long ibwdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                }
                return retval;
        }
+       case WDIOC_KEEPALIVE:
+               ibwdt_ping();
+               break;
+
+       case WDIOC_SETTIMEOUT:
+               if (get_user(new_margin, p))
+                       return -EFAULT;
+               if (ibwdt_set_heartbeat(new_margin))
+                       return -EINVAL;
+               ibwdt_ping();
+               /* Fall */
+
+       case WDIOC_GETTIMEOUT:
+               return put_user(wd_times[wd_margin], p);
+
        default:
                return -ENOTTY;
        }
index 6824bf8..0b549f3 100644 (file)
@@ -287,16 +287,6 @@ static long asr_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        case WDIOC_GETSTATUS:
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, p);
-       case WDIOC_KEEPALIVE:
-               asr_toggle();
-               return 0;
-       /*
-        * The hardware has a fixed timeout value, so no WDIOC_SETTIMEOUT
-        * and WDIOC_GETTIMEOUT always returns 256.
-        */
-       case WDIOC_GETTIMEOUT:
-               heartbeat = 256;
-               return put_user(heartbeat, p);
        case WDIOC_SETOPTIONS:
        {
                int new_options, retval = -EINVAL;
@@ -313,6 +303,16 @@ static long asr_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                }
                return retval;
        }
+       case WDIOC_KEEPALIVE:
+               asr_toggle();
+               return 0;
+       /*
+        * The hardware has a fixed timeout value, so no WDIOC_SETTIMEOUT
+        * and WDIOC_GETTIMEOUT always returns 256.
+        */
+       case WDIOC_GETTIMEOUT:
+               heartbeat = 256;
+               return put_user(heartbeat, p);
        default:
                return -ENOTTY;
        }
index 0bffea3..73c9e79 100644 (file)
@@ -128,11 +128,6 @@ static long indydog_ioctl(struct file *file, unsigned int cmd,
        case WDIOC_GETSTATUS:
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, (int *)arg);
-       case WDIOC_KEEPALIVE:
-               indydog_ping();
-               return 0;
-       case WDIOC_GETTIMEOUT:
-               return put_user(WATCHDOG_TIMEOUT, (int *)arg);
        case WDIOC_SETOPTIONS:
        {
                if (get_user(options, (int *)arg))
@@ -147,6 +142,11 @@ static long indydog_ioctl(struct file *file, unsigned int cmd,
                }
                return retval;
        }
+       case WDIOC_KEEPALIVE:
+               indydog_ping();
+               return 0;
+       case WDIOC_GETTIMEOUT:
+               return put_user(WATCHDOG_TIMEOUT, (int *)arg);
        default:
                return -ENOTTY;
        }
index e54c888..e0d0a90 100644 (file)
@@ -153,15 +153,6 @@ static long iop_wdt_ioctl(struct file *file,
                ret = put_user(boot_status, argp);
                break;
 
-       case WDIOC_GETTIMEOUT:
-               ret = put_user(iop_watchdog_timeout(), argp);
-               break;
-
-       case WDIOC_KEEPALIVE:
-               wdt_enable();
-               ret = 0;
-               break;
-
        case WDIOC_SETOPTIONS:
                if (get_user(options, (int *)arg))
                        return -EFAULT;
@@ -181,6 +172,15 @@ static long iop_wdt_ioctl(struct file *file,
                        ret = 0;
                }
                break;
+
+       case WDIOC_KEEPALIVE:
+               wdt_enable();
+               ret = 0;
+               break;
+
+       case WDIOC_GETTIMEOUT:
+               ret = put_user(iop_watchdog_timeout(), argp);
+               break;
        }
        return ret;
 }
index 51bfd57..c1db74f 100644 (file)
@@ -244,8 +244,6 @@ static long it8712f_wdt_ioctl(struct file *file, unsigned int cmd,
        int value;
 
        switch (cmd) {
-       default:
-               return -ENOTTY;
        case WDIOC_GETSUPPORT:
                if (copy_to_user(argp, &ident, sizeof(ident)))
                        return -EFAULT;
@@ -284,6 +282,8 @@ static long it8712f_wdt_ioctl(struct file *file, unsigned int cmd,
                if (put_user(margin, p))
                        return -EFAULT;
                return 0;
+       default:
+               return -ENOTTY;
        }
 }
 
index 943ceff..a77f69d 100644 (file)
@@ -126,6 +126,11 @@ static long ixp2000_wdt_ioctl(struct file *file, unsigned int cmd,
                ret = put_user(0, (int *)arg);
                break;
 
+       case WDIOC_KEEPALIVE:
+               wdt_enable();
+               ret = 0;
+               break;
+
        case WDIOC_SETTIMEOUT:
                ret = get_user(time, (int *)arg);
                if (ret)
@@ -143,11 +148,6 @@ static long ixp2000_wdt_ioctl(struct file *file, unsigned int cmd,
        case WDIOC_GETTIMEOUT:
                ret = put_user(heartbeat, (int *)arg);
                break;
-
-       case WDIOC_KEEPALIVE:
-               wdt_enable();
-               ret = 0;
-               break;
        }
 
        return ret;
index 1bafd7b..b94713e 100644 (file)
@@ -117,6 +117,11 @@ static long ixp4xx_wdt_ioctl(struct file *file, unsigned int cmd,
                ret = put_user(boot_status, (int *)arg);
                break;
 
+       case WDIOC_KEEPALIVE:
+               wdt_enable();
+               ret = 0;
+               break;
+
        case WDIOC_SETTIMEOUT:
                ret = get_user(time, (int *)arg);
                if (ret)
@@ -134,11 +139,6 @@ static long ixp4xx_wdt_ioctl(struct file *file, unsigned int cmd,
        case WDIOC_GETTIMEOUT:
                ret = put_user(heartbeat, (int *)arg);
                break;
-
-       case WDIOC_KEEPALIVE:
-               wdt_enable();
-               ret = 0;
-               break;
        }
        return ret;
 }
index 6d052b8..f8566d5 100644 (file)
@@ -161,23 +161,9 @@ static long ks8695_wdt_ioctl(struct file *file, unsigned int cmd,
        int new_value;
 
        switch (cmd) {
-       case WDIOC_KEEPALIVE:
-               ks8695_wdt_reload();    /* pat the watchdog */
-               return 0;
        case WDIOC_GETSUPPORT:
                return copy_to_user(argp, &ks8695_wdt_info,
                                        sizeof(ks8695_wdt_info)) ? -EFAULT : 0;
-       case WDIOC_SETTIMEOUT:
-               if (get_user(new_value, p))
-                       return -EFAULT;
-               if (ks8695_wdt_settimeout(new_value))
-                       return -EINVAL;
-               /* Enable new time value */
-               ks8695_wdt_start();
-               /* Return current value */
-               return put_user(wdt_time, p);
-       case WDIOC_GETTIMEOUT:
-               return put_user(wdt_time, p);
        case WDIOC_GETSTATUS:
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, p);
@@ -189,6 +175,20 @@ static long ks8695_wdt_ioctl(struct file *file, unsigned int cmd,
                if (new_value & WDIOS_ENABLECARD)
                        ks8695_wdt_start();
                return 0;
+       case WDIOC_KEEPALIVE:
+               ks8695_wdt_reload();    /* pat the watchdog */
+               return 0;
+       case WDIOC_SETTIMEOUT:
+               if (get_user(new_value, p))
+                       return -EFAULT;
+               if (ks8695_wdt_settimeout(new_value))
+                       return -EINVAL;
+               /* Enable new time value */
+               ks8695_wdt_start();
+               /* Return current value */
+               return put_user(wdt_time, p);
+       case WDIOC_GETTIMEOUT:
+               return put_user(wdt_time, p);
        default:
                return -ENOTTY;
        }
index 2248a81..407b025 100644 (file)
@@ -208,6 +208,10 @@ static long mixcomwd_ioctl(struct file *file,
        };
 
        switch (cmd) {
+       case WDIOC_GETSUPPORT:
+               if (copy_to_user(argp, &ident, sizeof(ident)))
+                       return -EFAULT;
+               break;
        case WDIOC_GETSTATUS:
                status = mixcomwd_opened;
                if (!nowayout)
@@ -215,10 +219,6 @@ static long mixcomwd_ioctl(struct file *file,
                return put_user(status, p);
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, p);
-       case WDIOC_GETSUPPORT:
-               if (copy_to_user(argp, &ident, sizeof(ident)))
-                       return -EFAULT;
-               break;
        case WDIOC_KEEPALIVE:
                mixcomwd_ping();
                break;
index 5e58f8b..3c4f955 100644 (file)
@@ -243,6 +243,12 @@ static long mpcore_wdt_ioctl(struct file *file, unsigned int cmd,
                ret = 0;
                break;
 
+       case WDIOC_GETSTATUS:
+       case WDIOC_GETBOOTSTATUS:
+               uarg.i = 0;
+               ret = 0;
+               break;
+
        case WDIOC_SETOPTIONS:
                ret = -EINVAL;
                if (uarg.i & WDIOS_DISABLECARD) {
@@ -255,12 +261,6 @@ static long mpcore_wdt_ioctl(struct file *file, unsigned int cmd,
                }
                break;
 
-       case WDIOC_GETSTATUS:
-       case WDIOC_GETBOOTSTATUS:
-               uarg.i = 0;
-               ret = 0;
-               break;
-
        case WDIOC_KEEPALIVE:
                mpcore_wdt_keepalive(wdt);
                ret = 0;
index e0b8cdf..f820b82 100644 (file)
@@ -148,17 +148,14 @@ static long mtx1_wdt_ioctl(struct file *file, unsigned int cmd,
        };
 
        switch (cmd) {
-       case WDIOC_KEEPALIVE:
-               mtx1_wdt_reset();
+       case WDIOC_GETSUPPORT:
+               if (copy_to_user(argp, &ident, sizeof(ident)))
+                       return -EFAULT;
                break;
        case WDIOC_GETSTATUS:
        case WDIOC_GETBOOTSTATUS:
                put_user(0, p);
                break;
-       case WDIOC_GETSUPPORT:
-               if (copy_to_user(argp, &ident, sizeof(ident)))
-                       return -EFAULT;
-               break;
        case WDIOC_SETOPTIONS:
                if (get_user(value, p))
                        return -EFAULT;
@@ -169,6 +166,9 @@ static long mtx1_wdt_ioctl(struct file *file, unsigned int cmd,
                else
                        return -EINVAL;
                return 0;
+       case WDIOC_KEEPALIVE:
+               mtx1_wdt_reset();
+               break;
        default:
                return -ENOTTY;
        }
index 5aae071..7beb21c 100644 (file)
@@ -197,8 +197,6 @@ static long omap_wdt_ioctl(struct file *file, unsigned int cmd,
        };
 
        switch (cmd) {
-       default:
-               return -ENOTTY;
        case WDIOC_GETSUPPORT:
                return copy_to_user((struct watchdog_info __user *)arg, &ident,
                                sizeof(ident));
@@ -231,6 +229,8 @@ static long omap_wdt_ioctl(struct file *file, unsigned int cmd,
                /* Fall */
        case WDIOC_GETTIMEOUT:
                return put_user(timer_margin, (int __user *)arg);
+       default:
+               return -ENOTTY;
        }
 }
 
index 326f2d2..5fc7f13 100644 (file)
@@ -426,6 +426,21 @@ static long pc87413_ioctl(struct file *file, unsigned int cmd,
                return put_user(pc87413_status(), uarg.i);
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, uarg.i);
+       case WDIOC_SETOPTIONS:
+       {
+               int options, retval = -EINVAL;
+               if (get_user(options, uarg.i))
+                       return -EFAULT;
+               if (options & WDIOS_DISABLECARD) {
+                       pc87413_disable();
+                       retval = 0;
+               }
+               if (options & WDIOS_ENABLECARD) {
+                       pc87413_enable();
+                       retval = 0;
+               }
+               return retval;
+       }
        case WDIOC_KEEPALIVE:
                pc87413_refresh();
 #ifdef DEBUG
@@ -445,21 +460,6 @@ static long pc87413_ioctl(struct file *file, unsigned int cmd,
        case WDIOC_GETTIMEOUT:
                new_timeout = timeout * 60;
                return put_user(new_timeout, uarg.i);
-       case WDIOC_SETOPTIONS:
-       {
-               int options, retval = -EINVAL;
-               if (get_user(options, uarg.i))
-                       return -EFAULT;
-               if (options & WDIOS_DISABLECARD) {
-                       pc87413_disable();
-                       retval = 0;
-               }
-               if (options & WDIOS_ENABLECARD) {
-                       pc87413_enable();
-                       retval = 0;
-               }
-               return retval;
-       }
        default:
                return -ENOTTY;
        }
index e1259ad..134386a 100644 (file)
@@ -612,9 +612,6 @@ static long pcwd_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        };
 
        switch (cmd) {
-       default:
-               return -ENOTTY;
-
        case WDIOC_GETSUPPORT:
                if (copy_to_user(argp, &ident, sizeof(ident)))
                        return -EFAULT;
@@ -669,6 +666,9 @@ static long pcwd_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 
        case WDIOC_GETTIMEOUT:
                return put_user(heartbeat, argp);
+
+       default:
+               return -ENOTTY;
        }
 
        return 0;
index 7f500ee..2617129 100644 (file)
@@ -494,10 +494,6 @@ static long pcipcwd_ioctl(struct file *file, unsigned int cmd,
                return put_user(temperature, p);
        }
 
-       case WDIOC_KEEPALIVE:
-               pcipcwd_keepalive();
-               return 0;
-
        case WDIOC_SETOPTIONS:
        {
                int new_options, retval = -EINVAL;
@@ -525,6 +521,10 @@ static long pcipcwd_ioctl(struct file *file, unsigned int cmd,
                return retval;
        }
 
+       case WDIOC_KEEPALIVE:
+               pcipcwd_keepalive();
+               return 0;
+
        case WDIOC_SETTIMEOUT:
        {
                int new_heartbeat;
index 8194435..8c582bc 100644 (file)
@@ -400,10 +400,6 @@ static long usb_pcwd_ioctl(struct file *file, unsigned int cmd,
                return put_user(temperature, p);
        }
 
-       case WDIOC_KEEPALIVE:
-               usb_pcwd_keepalive(usb_pcwd_device);
-               return 0;
-
        case WDIOC_SETOPTIONS:
        {
                int new_options, retval = -EINVAL;
@@ -424,6 +420,10 @@ static long usb_pcwd_ioctl(struct file *file, unsigned int cmd,
                return retval;
        }
 
+       case WDIOC_KEEPALIVE:
+               usb_pcwd_keepalive(usb_pcwd_device);
+               return 0;
+
        case WDIOC_SETTIMEOUT:
        {
                int new_heartbeat;
index 56dee3b..6eadf5e 100644 (file)
@@ -194,6 +194,11 @@ static long pnx4008_wdt_ioctl(struct inode *inode, struct file *file,
                ret = put_user(boot_status, (int *)arg);
                break;
 
+       case WDIOC_KEEPALIVE:
+               wdt_enable();
+               ret = 0;
+               break;
+
        case WDIOC_SETTIMEOUT:
                ret = get_user(time, (int *)arg);
                if (ret)
@@ -211,11 +216,6 @@ static long pnx4008_wdt_ioctl(struct inode *inode, struct file *file,
        case WDIOC_GETTIMEOUT:
                ret = put_user(heartbeat, (int *)arg);
                break;
-
-       case WDIOC_KEEPALIVE:
-               wdt_enable();
-               ret = 0;
-               break;
        }
        return ret;
 }
index 97b4a2e..44bf5e4 100644 (file)
@@ -305,8 +305,6 @@ static long s3c2410wdt_ioctl(struct file *file,     unsigned int cmd,
        int new_margin;
 
        switch (cmd) {
-       default:
-               return -ENOTTY;
        case WDIOC_GETSUPPORT:
                return copy_to_user(argp, &s3c2410_wdt_ident,
                        sizeof(s3c2410_wdt_ident)) ? -EFAULT : 0;
@@ -325,6 +323,8 @@ static long s3c2410wdt_ioctl(struct file *file,     unsigned int cmd,
                return put_user(tmr_margin, p);
        case WDIOC_GETTIMEOUT:
                return put_user(tmr_margin, p);
+       default:
+               return -ENOTTY;
        }
 }
 
index 869d538..27d6898 100644 (file)
@@ -107,6 +107,11 @@ static long sa1100dog_ioctl(struct file *file, unsigned int cmd,
                ret = put_user(boot_status, p);
                break;
 
+       case WDIOC_KEEPALIVE:
+               OSMR3 = OSCR + pre_margin;
+               ret = 0;
+               break;
+
        case WDIOC_SETTIMEOUT:
                ret = get_user(time, p);
                if (ret)
@@ -124,11 +129,6 @@ static long sa1100dog_ioctl(struct file *file, unsigned int cmd,
        case WDIOC_GETTIMEOUT:
                ret = put_user(pre_margin / OSCR_FREQ, p);
                break;
-
-       case WDIOC_KEEPALIVE:
-               OSMR3 = OSCR + pre_margin;
-               ret = 0;
-               break;
        }
        return ret;
 }
index c8b544c..5280976 100644 (file)
@@ -182,6 +182,11 @@ static long sbwdog_ioctl(struct file *file, unsigned int cmd,
                ret = put_user(0, p);
                break;
 
+       case WDIOC_KEEPALIVE:
+               sbwdog_pet(user_dog);
+               ret = 0;
+               break;
+
        case WDIOC_SETTIMEOUT:
                ret = get_user(time, p);
                if (ret)
@@ -203,11 +208,6 @@ static long sbwdog_ioctl(struct file *file, unsigned int cmd,
                 */
                ret = put_user(__raw_readq(user_dog - 8) / 1000000, p);
                break;
-
-       case WDIOC_KEEPALIVE:
-               sbwdog_pet(user_dog);
-               ret = 0;
-               break;
        }
        return ret;
 }
index e284a5d..e801cd4 100644 (file)
@@ -237,16 +237,11 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        };
 
        switch (cmd) {
-       default:
-               return -ENOTTY;
        case WDIOC_GETSUPPORT:
                return copy_to_user(argp, &ident, sizeof(ident))? -EFAULT : 0;
        case WDIOC_GETSTATUS:
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, p);
-       case WDIOC_KEEPALIVE:
-               wdt_keepalive();
-               return 0;
        case WDIOC_SETOPTIONS:
        {
                int new_options, retval = -EINVAL;
@@ -262,6 +257,9 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                }
                return retval;
        }
+       case WDIOC_KEEPALIVE:
+               wdt_keepalive();
+               return 0;
        case WDIOC_SETTIMEOUT:
        {
                int new_timeout;
@@ -277,6 +275,8 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        }
        case WDIOC_GETTIMEOUT:
                return put_user(timeout, p);
+       default:
+               return -ENOTTY;
        }
 }
 
index abccbe2..67ddeb1 100644 (file)
@@ -177,39 +177,41 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        case WDIOC_GETSTATUS:
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, (int __user *)arg);
-       case WDIOC_KEEPALIVE:
-               wdt_keepalive();
-               return 0;
-       case WDIOC_SETOPTIONS:{
-                       int options;
-                       int retval = -EINVAL;
+       case WDIOC_SETOPTIONS:
+       {
+               int options;
+               int retval = -EINVAL;
 
-                       if (get_user(options, (int __user *)arg))
-                               return -EFAULT;
+               if (get_user(options, (int __user *)arg))
+                       return -EFAULT;
 
-                       if (options & WDIOS_DISABLECARD) {
-                               wdt_disable();
-                               retval = 0;
-                       }
-
-                       if (options & WDIOS_ENABLECARD) {
-                               wdt_enable();
-                               retval = 0;
-                       }
+               if (options & WDIOS_DISABLECARD) {
+                       wdt_disable();
+                       retval = 0;
+               }
 
-                       return retval;
+               if (options & WDIOS_ENABLECARD) {
+                       wdt_enable();
+                       retval = 0;
                }
-       case WDIOC_SETTIMEOUT:{
-                       int new_timeout;
 
-                       if (get_user(new_timeout, (int __user *)arg))
-                               return -EFAULT;
+               return retval;
+       }
+       case WDIOC_KEEPALIVE:
+               wdt_keepalive();
+               return 0;
+       case WDIOC_SETTIMEOUT:
+       {
+               int new_timeout;
 
-                       if (wdt_set_timeout(new_timeout))
-                               return -EINVAL;
+               if (get_user(new_timeout, (int __user *)arg))
+                       return -EFAULT;
 
-                       /* Fall through */
-               }
+               if (wdt_set_timeout(new_timeout))
+                       return -EINVAL;
+
+               /* Fall through */
+       }
        case WDIOC_GETTIMEOUT:
                return put_user(timeout, (int __user *)arg);
        default:
index 70ff9cb..e5e470c 100644 (file)
@@ -120,11 +120,6 @@ static long epx_c3_ioctl(struct file *file, unsigned int cmd,
        case WDIOC_GETSTATUS:
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, argp);
-       case WDIOC_KEEPALIVE:
-               epx_c3_pet();
-               return 0;
-       case WDIOC_GETTIMEOUT:
-               return put_user(WATCHDOG_TIMEOUT, argp);
        case WDIOC_SETOPTIONS:
                if (get_user(options, argp))
                        return -EFAULT;
@@ -140,6 +135,11 @@ static long epx_c3_ioctl(struct file *file, unsigned int cmd,
                }
 
                return retval;
+       case WDIOC_KEEPALIVE:
+               epx_c3_pet();
+               return 0;
+       case WDIOC_GETTIMEOUT:
+               return put_user(WATCHDOG_TIMEOUT, argp);
        default:
                return -ENOTTY;
        }
index 03e67fa..f3bdc82 100644 (file)
@@ -207,24 +207,6 @@ static long sc1200wdt_ioctl(struct file *file, unsigned int cmd,
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, p);
 
-       case WDIOC_KEEPALIVE:
-               sc1200wdt_write_data(WDTO, timeout);
-               return 0;
-
-       case WDIOC_SETTIMEOUT:
-               if (get_user(new_timeout, p))
-                       return -EFAULT;
-               /* the API states this is given in secs */
-               new_timeout /= 60;
-               if (new_timeout < 0 || new_timeout > MAX_TIMEOUT)
-                       return -EINVAL;
-               timeout = new_timeout;
-               sc1200wdt_write_data(WDTO, timeout);
-               /* fall through and return the new timeout */
-
-       case WDIOC_GETTIMEOUT:
-               return put_user(timeout * 60, p);
-
        case WDIOC_SETOPTIONS:
        {
                int options, retval = -EINVAL;
@@ -244,6 +226,24 @@ static long sc1200wdt_ioctl(struct file *file, unsigned int cmd,
 
                return retval;
        }
+       case WDIOC_KEEPALIVE:
+               sc1200wdt_write_data(WDTO, timeout);
+               return 0;
+
+       case WDIOC_SETTIMEOUT:
+               if (get_user(new_timeout, p))
+                       return -EFAULT;
+               /* the API states this is given in secs */
+               new_timeout /= 60;
+               if (new_timeout < 0 || new_timeout > MAX_TIMEOUT)
+                       return -EINVAL;
+               timeout = new_timeout;
+               sc1200wdt_write_data(WDTO, timeout);
+               /* fall through and return the new timeout */
+
+       case WDIOC_GETTIMEOUT:
+               return put_user(timeout * 60, p);
+
        default:
                return -ENOTTY;
        }
index 1d5ba15..a2b6c10 100644 (file)
@@ -291,16 +291,11 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        };
 
        switch (cmd) {
-       default:
-               return -ENOTTY;
        case WDIOC_GETSUPPORT:
                return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
        case WDIOC_GETSTATUS:
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, p);
-       case WDIOC_KEEPALIVE:
-               wdt_keepalive();
-               return 0;
        case WDIOC_SETOPTIONS:
        {
                int new_options, retval = -EINVAL;
@@ -320,6 +315,9 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 
                return retval;
        }
+       case WDIOC_KEEPALIVE:
+               wdt_keepalive();
+               return 0;
        case WDIOC_SETTIMEOUT:
        {
                int new_timeout;
@@ -335,6 +333,8 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        }
        case WDIOC_GETTIMEOUT:
                return put_user(timeout, p);
+       default:
+               return -ENOTTY;
        }
 }
 
index 7c1de94..fd5c094 100644 (file)
@@ -168,8 +168,6 @@ static long scx200_wdt_ioctl(struct file *file, unsigned int cmd,
        int new_margin;
 
        switch (cmd) {
-       default:
-               return -ENOTTY;
        case WDIOC_GETSUPPORT:
                if (copy_to_user(argp, &ident, sizeof(ident)))
                        return -EFAULT;
@@ -194,6 +192,8 @@ static long scx200_wdt_ioctl(struct file *file, unsigned int cmd,
                if (put_user(margin, p))
                        return -EFAULT;
                return 0;
+       default:
+               return -ENOTTY;
        }
 }
 
index 60f0036..824125a 100644 (file)
@@ -351,20 +351,6 @@ static long sh_wdt_ioctl(struct file *file, unsigned int cmd,
        case WDIOC_GETSTATUS:
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, (int *)arg);
-       case WDIOC_KEEPALIVE:
-               sh_wdt_keepalive();
-               return 0;
-       case WDIOC_SETTIMEOUT:
-               if (get_user(new_heartbeat, (int *)arg))
-                       return -EFAULT;
-
-               if (sh_wdt_set_heartbeat(new_heartbeat))
-                       return -EINVAL;
-
-               sh_wdt_keepalive();
-               /* Fall */
-       case WDIOC_GETTIMEOUT:
-               return put_user(heartbeat, (int *)arg);
        case WDIOC_SETOPTIONS:
                if (get_user(options, (int *)arg))
                        return -EFAULT;
@@ -380,6 +366,20 @@ static long sh_wdt_ioctl(struct file *file, unsigned int cmd,
                }
 
                return retval;
+       case WDIOC_KEEPALIVE:
+               sh_wdt_keepalive();
+               return 0;
+       case WDIOC_SETTIMEOUT:
+               if (get_user(new_heartbeat, (int *)arg))
+                       return -EFAULT;
+
+               if (sh_wdt_set_heartbeat(new_heartbeat))
+                       return -EINVAL;
+
+               sh_wdt_keepalive();
+               /* Fall */
+       case WDIOC_GETTIMEOUT:
+               return put_user(heartbeat, (int *)arg);
        default:
                return -ENOTTY;
        }
index b7c6394..239383d 100644 (file)
@@ -451,6 +451,23 @@ static long wb_smsc_wdt_ioctl(struct file *file,
                return put_user(wb_smsc_wdt_status(), uarg.i);
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, uarg.i);
+       case WDIOC_SETOPTIONS:
+       {
+               int options, retval = -EINVAL;
+
+               if (get_user(options, uarg.i))
+                       return -EFAULT;
+
+               if (options & WDIOS_DISABLECARD) {
+                       wb_smsc_wdt_disable();
+                       retval = 0;
+               }
+               if (options & WDIOS_ENABLECARD) {
+                       wb_smsc_wdt_enable();
+                       retval = 0;
+               }
+               return retval;
+       }
        case WDIOC_KEEPALIVE:
                wb_smsc_wdt_reset_timer();
                return 0;
@@ -470,23 +487,6 @@ static long wb_smsc_wdt_ioctl(struct file *file,
                if (unit == UNIT_MINUTE)
                          new_timeout *= 60;
                return put_user(new_timeout, uarg.i);
-       case WDIOC_SETOPTIONS:
-       {
-               int options, retval = -EINVAL;
-
-               if (get_user(options, uarg.i))
-                       return -EFAULT;
-
-               if (options & WDIOS_DISABLECARD) {
-                       wb_smsc_wdt_disable();
-                       retval = 0;
-               }
-               if (options & WDIOS_ENABLECARD) {
-                       wb_smsc_wdt_enable();
-                       retval = 0;
-               }
-               return retval;
-       }
        default:
                return -ENOTTY;
        }
index bb3c75e..c650464 100644 (file)
@@ -206,8 +206,6 @@ static long softdog_ioctl(struct file *file, unsigned int cmd,
                .identity =             "Software Watchdog",
        };
        switch (cmd) {
-       default:
-               return -ENOTTY;
        case WDIOC_GETSUPPORT:
                return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
        case WDIOC_GETSTATUS:
@@ -225,6 +223,8 @@ static long softdog_ioctl(struct file *file, unsigned int cmd,
                /* Fall */
        case WDIOC_GETTIMEOUT:
                return put_user(soft_margin, p);
+       default:
+               return -ENOTTY;
        }
 }
 
index b729cc4..8382f9a 100644 (file)
@@ -142,8 +142,6 @@ static long txx9wdt_ioctl(struct file *file, unsigned int cmd,
        };
 
        switch (cmd) {
-       default:
-               return -ENOTTY;
        case WDIOC_GETSUPPORT:
                return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
        case WDIOC_GETSTATUS:
@@ -163,6 +161,8 @@ static long txx9wdt_ioctl(struct file *file, unsigned int cmd,
                /* Fall */
        case WDIOC_GETTIMEOUT:
                return put_user(timeout, p);
+       default:
+               return -ENOTTY;
        }
 }
 
index 70c843f..59507f6 100644 (file)
@@ -211,18 +211,6 @@ static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        case WDIOC_GETSTATUS:
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, p);
-       case WDIOC_KEEPALIVE:
-               wdt_ping();
-               break;
-       case WDIOC_SETTIMEOUT:
-               if (get_user(new_timeout, p))
-                       return -EFAULT;
-               if (wdt_set_heartbeat(new_timeout))
-                       return -EINVAL;
-               wdt_ping();
-               /* Fall */
-       case WDIOC_GETTIMEOUT:
-               return put_user(timeout, p);
        case WDIOC_SETOPTIONS:
        {
                int options, retval = -EINVAL;
@@ -239,6 +227,18 @@ static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                }
                return retval;
        }
+       case WDIOC_KEEPALIVE:
+               wdt_ping();
+               break;
+       case WDIOC_SETTIMEOUT:
+               if (get_user(new_timeout, p))
+                       return -EFAULT;
+               if (wdt_set_heartbeat(new_timeout))
+                       return -EINVAL;
+               wdt_ping();
+               /* Fall */
+       case WDIOC_GETTIMEOUT:
+               return put_user(timeout, p);
        default:
                return -ENOTTY;
        }
index 06ddd38..12bd661 100644 (file)
@@ -251,21 +251,6 @@ static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, p);
 
-       case WDIOC_KEEPALIVE:
-               wdt_ping();
-               break;
-
-       case WDIOC_SETTIMEOUT:
-               if (get_user(new_timeout, p))
-                       return -EFAULT;
-               if (wdt_set_heartbeat(new_timeout))
-                       return -EINVAL;
-               wdt_ping();
-               /* Fall */
-
-       case WDIOC_GETTIMEOUT:
-               return put_user(timeout, p);
-
        case WDIOC_SETOPTIONS:
        {
                int options, retval = -EINVAL;
@@ -286,6 +271,21 @@ static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                return retval;
        }
 
+       case WDIOC_KEEPALIVE:
+               wdt_ping();
+               break;
+
+       case WDIOC_SETTIMEOUT:
+               if (get_user(new_timeout, p))
+                       return -EFAULT;
+               if (wdt_set_heartbeat(new_timeout))
+                       return -EINVAL;
+               wdt_ping();
+               /* Fall */
+
+       case WDIOC_GETTIMEOUT:
+               return put_user(timeout, p);
+
        default:
                return -ENOTTY;
        }
index 75b546d..24587d2 100644 (file)
@@ -254,16 +254,11 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        };
 
        switch (cmd) {
-       default:
-               return -ENOTTY;
        case WDIOC_GETSUPPORT:
                return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
        case WDIOC_GETSTATUS:
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, p);
-       case WDIOC_KEEPALIVE:
-               wdt_keepalive();
-               return 0;
        case WDIOC_SETOPTIONS:
        {
                int new_options, retval = -EINVAL;
@@ -283,6 +278,9 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 
                return retval;
        }
+       case WDIOC_KEEPALIVE:
+               wdt_keepalive();
+               return 0;
        case WDIOC_SETTIMEOUT:
        {
                int new_timeout;
@@ -300,6 +298,8 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        }
        case WDIOC_GETTIMEOUT:
                return put_user(timeout, p);
+       default:
+               return -ENOTTY;
        }
 }
 
index 6860a13..2525da5 100644 (file)
@@ -390,9 +390,6 @@ static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        uarg.i = (int __user *)arg;
 
        switch (cmd) {
-       default:
-               return -ENOTTY;
-
        case WDIOC_GETSUPPORT:
                return copy_to_user(uarg.ident, &ident,
                                                sizeof(ident)) ? -EFAULT : 0;
@@ -404,10 +401,6 @@ static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, uarg.i);
 
-       case WDIOC_KEEPALIVE:
-               wdt_keepalive();
-               return 0;
-
        case WDIOC_SETOPTIONS:
                if (get_user(new_options, uarg.i))
                        return -EFAULT;
@@ -424,6 +417,10 @@ static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 
                return retval;
 
+       case WDIOC_KEEPALIVE:
+               wdt_keepalive();
+               return 0;
+
        case WDIOC_SETTIMEOUT:
                if (get_user(new_timeout, uarg.i))
                        return -EFAULT;
@@ -437,6 +434,9 @@ static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        case WDIOC_GETTIMEOUT:
                return put_user(timeout, uarg.i);
 
+       default:
+               return -ENOTTY;
+
        }
 }
 
index 886cbbc..44e81f7 100644 (file)
@@ -145,22 +145,6 @@ static long wafwdt_ioctl(struct file *file, unsigned int cmd,
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, p);
 
-       case WDIOC_KEEPALIVE:
-               wafwdt_ping();
-               break;
-
-       case WDIOC_SETTIMEOUT:
-               if (get_user(new_timeout, p))
-                       return -EFAULT;
-               if ((new_timeout < 1) || (new_timeout > 255))
-                       return -EINVAL;
-               timeout = new_timeout;
-               wafwdt_stop();
-               wafwdt_start();
-               /* Fall */
-       case WDIOC_GETTIMEOUT:
-               return put_user(timeout, p);
-
        case WDIOC_SETOPTIONS:
        {
                int options, retval = -EINVAL;
@@ -181,6 +165,22 @@ static long wafwdt_ioctl(struct file *file, unsigned int cmd,
                return retval;
        }
 
+       case WDIOC_KEEPALIVE:
+               wafwdt_ping();
+               break;
+
+       case WDIOC_SETTIMEOUT:
+               if (get_user(new_timeout, p))
+                       return -EFAULT;
+               if ((new_timeout < 1) || (new_timeout > 255))
+                       return -EINVAL;
+               timeout = new_timeout;
+               wafwdt_stop();
+               wafwdt_start();
+               /* Fall */
+       case WDIOC_GETTIMEOUT:
+               return put_user(timeout, p);
+
        default:
                return -ENOTTY;
        }
index 53a6b18..deeebb2 100644 (file)
@@ -373,8 +373,6 @@ static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 #endif /* CONFIG_WDT_501 */
 
        switch (cmd) {
-       default:
-               return -ENOTTY;
        case WDIOC_GETSUPPORT:
                return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
        case WDIOC_GETSTATUS:
@@ -394,6 +392,8 @@ static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                /* Fall */
        case WDIOC_GETTIMEOUT:
                return put_user(heartbeat, p);
+       default:
+               return -ENOTTY;
        }
 }
 
index bdc28e5..60e28d4 100644 (file)
@@ -365,9 +365,6 @@ static long wdt977_ioctl(struct file *file, unsigned int cmd,
        uarg.i = (int __user *)arg;
 
        switch (cmd) {
-       default:
-               return -ENOTTY;
-
        case WDIOC_GETSUPPORT:
                return copy_to_user(uarg.ident, &ident,
                        sizeof(ident)) ? -EFAULT : 0;
@@ -379,10 +376,6 @@ static long wdt977_ioctl(struct file *file, unsigned int cmd,
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, uarg.i);
 
-       case WDIOC_KEEPALIVE:
-               wdt977_keepalive();
-               return 0;
-
        case WDIOC_SETOPTIONS:
                if (get_user(new_options, uarg.i))
                        return -EFAULT;
@@ -399,6 +392,10 @@ static long wdt977_ioctl(struct file *file, unsigned int cmd,
 
                return retval;
 
+       case WDIOC_KEEPALIVE:
+               wdt977_keepalive();
+               return 0;
+
        case WDIOC_SETTIMEOUT:
                if (get_user(new_timeout, uarg.i))
                        return -EFAULT;
@@ -412,6 +409,9 @@ static long wdt977_ioctl(struct file *file, unsigned int cmd,
        case WDIOC_GETTIMEOUT:
                return put_user(timeout, uarg.i);
 
+       default:
+               return -ENOTTY;
+
        }
 }
 
index 5d922fd..fb8fc01 100644 (file)
@@ -428,8 +428,6 @@ static long wdtpci_ioctl(struct file *file, unsigned int cmd,
 #endif /* CONFIG_WDT_501_PCI */
 
        switch (cmd) {
-       default:
-               return -ENOTTY;
        case WDIOC_GETSUPPORT:
                return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
        case WDIOC_GETSTATUS:
@@ -449,7 +447,9 @@ static long wdtpci_ioctl(struct file *file, unsigned int cmd,
                /* Fall */
        case WDIOC_GETTIMEOUT:
                return put_user(heartbeat, p);
-               }
+       default:
+               return -ENOTTY;
+       }
 }
 
 /**