[WATCHDOG] WDIOC_GETSTATUS and WDIOC_GETBOOTSTATUS clean-up
authorWim Van Sebroeck <wim@iguana.be>
Sat, 21 Jul 2007 13:42:18 +0000 (13:42 +0000)
committerWim Van Sebroeck <wim@iguana.be>
Mon, 23 Jul 2007 17:26:49 +0000 (17:26 +0000)
Add mandatory WDIOC_GETSTATUS and WDIOC_GETBOOTSTATUS ioctl's for
drivers that don't have them yet.

Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
drivers/char/watchdog/cpu5wdt.c
drivers/char/watchdog/machzwd.c
drivers/char/watchdog/mixcomwd.c
drivers/char/watchdog/mpc83xx_wdt.c
drivers/char/watchdog/mtx-1_wdt.c

index d0d45a8b09f0a57c379028a4b4e62800c222e223..20eb6c3e98531115a891b3f5dee18446f22acbc8 100644 (file)
@@ -162,6 +162,10 @@ static int cpu5wdt_ioctl(struct inode *inode, struct file *file, unsigned int cm
                        if ( copy_to_user(argp, &value, sizeof(int)) )
                                return -EFAULT;
                        break;
+               case WDIOC_GETBOOTSTATUS:
+                       if ( copy_to_user(argp, &value, sizeof(int)) )
+                               retrun -EFAULT;
+                       break;
                case WDIOC_GETSUPPORT:
                        if ( copy_to_user(argp, &ident, sizeof(ident)) )
                                return -EFAULT;
index a0d27160c80e1f1e540c3cda4c80a0786dd03b5c..6d35bb112a5fc6a2507680f10153dd992fe6688e 100644 (file)
@@ -321,6 +321,7 @@ static int zf_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
                break;
 
        case WDIOC_GETSTATUS:
+       case WDIOC_GETBOOTSTATUS:
                return put_user(0, p);
 
        case WDIOC_KEEPALIVE:
index db2ccb864412f6ce24842c4db8bbf87e67560b11..1adf1d56027df58081b737201ddf860c420ce6fe 100644 (file)
@@ -215,6 +215,11 @@ static int mixcomwd_ioctl(struct inode *inode, struct file *file,
                                return -EFAULT;
                        }
                        break;
+               case WDIOC_GETBOOTSTATUS:
+                       if (copy_to_user(p, &status, sizeof(int))) {
+                               return -EFAULT;
+                       }
+                       break;
                case WDIOC_GETSUPPORT:
                        if (copy_to_user(argp, &ident, sizeof(ident))) {
                                return -EFAULT;
index 18ca752e2f904f7425208c0fd2453ef0c55ebd99..a0bf95fb976374099a7b1e27c0d3979f73841f74 100644 (file)
@@ -119,6 +119,9 @@ static int mpc83xx_wdt_ioctl(struct inode *inode, struct file *file,
        switch (cmd) {
        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:
                mpc83xx_wdt_keepalive();
                return 0;
index 419ab445c944d5fd9ffc1f64eff6d8891329e9e5..dcfd401a7ad725dc3d4a1febf7726482e1d56650 100644 (file)
@@ -143,6 +143,7 @@ static int mtx1_wdt_ioctl(struct inode *inode, struct file *file, unsigned int c
                        mtx1_wdt_reset();
                        break;
                case WDIOC_GETSTATUS:
+               case WDIOC_GETBOOTSTATUS:
                        if ( copy_to_user(argp, &value, sizeof(int)) )
                                return -EFAULT;
                        break;