Commit 5c4eb61b authored by Wim Van Sebroeck's avatar Wim Van Sebroeck

[WATCHDOG] WDIOC_GETSTATUS and WDIOC_GETBOOTSTATUS clean-up

Add mandatory WDIOC_GETSTATUS and WDIOC_GETBOOTSTATUS ioctl's for
drivers that don't have them yet.
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent ec9505a7
...@@ -162,6 +162,10 @@ static int cpu5wdt_ioctl(struct inode *inode, struct file *file, unsigned int cm ...@@ -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)) ) if ( copy_to_user(argp, &value, sizeof(int)) )
return -EFAULT; return -EFAULT;
break; break;
case WDIOC_GETBOOTSTATUS:
if ( copy_to_user(argp, &value, sizeof(int)) )
retrun -EFAULT;
break;
case WDIOC_GETSUPPORT: case WDIOC_GETSUPPORT:
if ( copy_to_user(argp, &ident, sizeof(ident)) ) if ( copy_to_user(argp, &ident, sizeof(ident)) )
return -EFAULT; return -EFAULT;
......
...@@ -321,6 +321,7 @@ static int zf_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -321,6 +321,7 @@ static int zf_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
break; break;
case WDIOC_GETSTATUS: case WDIOC_GETSTATUS:
case WDIOC_GETBOOTSTATUS:
return put_user(0, p); return put_user(0, p);
case WDIOC_KEEPALIVE: case WDIOC_KEEPALIVE:
......
...@@ -215,6 +215,11 @@ static int mixcomwd_ioctl(struct inode *inode, struct file *file, ...@@ -215,6 +215,11 @@ static int mixcomwd_ioctl(struct inode *inode, struct file *file,
return -EFAULT; return -EFAULT;
} }
break; break;
case WDIOC_GETBOOTSTATUS:
if (copy_to_user(p, &status, sizeof(int))) {
return -EFAULT;
}
break;
case WDIOC_GETSUPPORT: case WDIOC_GETSUPPORT:
if (copy_to_user(argp, &ident, sizeof(ident))) { if (copy_to_user(argp, &ident, sizeof(ident))) {
return -EFAULT; return -EFAULT;
......
...@@ -119,6 +119,9 @@ static int mpc83xx_wdt_ioctl(struct inode *inode, struct file *file, ...@@ -119,6 +119,9 @@ static int mpc83xx_wdt_ioctl(struct inode *inode, struct file *file,
switch (cmd) { switch (cmd) {
case WDIOC_GETSUPPORT: case WDIOC_GETSUPPORT:
return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0; return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
case WDIOC_GETSTATUS:
case WDIOC_GETBOOTSTATUS:
return put_user(0, p);
case WDIOC_KEEPALIVE: case WDIOC_KEEPALIVE:
mpc83xx_wdt_keepalive(); mpc83xx_wdt_keepalive();
return 0; return 0;
......
...@@ -143,6 +143,7 @@ static int mtx1_wdt_ioctl(struct inode *inode, struct file *file, unsigned int c ...@@ -143,6 +143,7 @@ static int mtx1_wdt_ioctl(struct inode *inode, struct file *file, unsigned int c
mtx1_wdt_reset(); mtx1_wdt_reset();
break; break;
case WDIOC_GETSTATUS: case WDIOC_GETSTATUS:
case WDIOC_GETBOOTSTATUS:
if ( copy_to_user(argp, &value, sizeof(int)) ) if ( copy_to_user(argp, &value, sizeof(int)) )
return -EFAULT; return -EFAULT;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment