Commit cb1d92f6 authored by Wim Van Sebroeck's avatar Wim Van Sebroeck

[WATCHDOG] 2.6.0-rc1 -ENOIOCTLCMD.patch

Make the default return value for the ioctl commands that don't exist = -ENOIOCTLCMD
parent c09b0a36
...@@ -183,7 +183,7 @@ advwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -183,7 +183,7 @@ advwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
} }
default: default:
return -ENOTTY; return -ENOIOCTLCMD;
} }
return 0; return 0;
} }
......
...@@ -175,7 +175,7 @@ static int amdtco_fop_ioctl(struct inode *inode, struct file *file, unsigned int ...@@ -175,7 +175,7 @@ static int amdtco_fop_ioctl(struct inode *inode, struct file *file, unsigned int
switch (cmd) { switch (cmd) {
default: default:
return -ENOTTY; return -ENOIOCTLCMD;
case WDIOC_GETSUPPORT: case WDIOC_GETSUPPORT:
if (copy_to_user((struct watchdog_info *)arg, &ident, sizeof ident)) if (copy_to_user((struct watchdog_info *)arg, &ident, sizeof ident))
......
...@@ -183,7 +183,7 @@ static int cpu5wdt_ioctl(struct inode *inode, struct file *file, unsigned int cm ...@@ -183,7 +183,7 @@ static int cpu5wdt_ioctl(struct inode *inode, struct file *file, unsigned int cm
} }
break; break;
default: default:
return -EINVAL; return -ENOIOCTLCMD;
} }
return 0; return 0;
} }
......
...@@ -277,7 +277,7 @@ static int eurwdt_ioctl(struct inode *inode, struct file *file, ...@@ -277,7 +277,7 @@ static int eurwdt_ioctl(struct inode *inode, struct file *file,
switch(cmd) { switch(cmd) {
default: default:
return -ENOTTY; return -ENOIOCTLCMD;
case WDIOC_GETSUPPORT: case WDIOC_GETSUPPORT:
return copy_to_user((struct watchdog_info *)arg, &ident, return copy_to_user((struct watchdog_info *)arg, &ident,
......
...@@ -255,7 +255,7 @@ static int i810tco_ioctl (struct inode *inode, struct file *file, ...@@ -255,7 +255,7 @@ static int i810tco_ioctl (struct inode *inode, struct file *file,
}; };
switch (cmd) { switch (cmd) {
default: default:
return -ENOTTY; return -ENOIOCTLCMD;
case WDIOC_GETSUPPORT: case WDIOC_GETSUPPORT:
if (copy_to_user if (copy_to_user
((struct watchdog_info *) arg, &ident, sizeof (ident))) ((struct watchdog_info *) arg, &ident, sizeof (ident)))
......
...@@ -207,7 +207,7 @@ ibwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -207,7 +207,7 @@ ibwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
break; break;
default: default:
return -ENOTTY; return -ENOIOCTLCMD;
} }
return 0; return 0;
} }
......
...@@ -366,7 +366,7 @@ static int zf_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -366,7 +366,7 @@ static int zf_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
break; break;
default: default:
return -ENOTTY; return -ENOIOCTLCMD;
} }
return 0; return 0;
......
...@@ -192,7 +192,7 @@ static int mixcomwd_ioctl(struct inode *inode, struct file *file, ...@@ -192,7 +192,7 @@ static int mixcomwd_ioctl(struct inode *inode, struct file *file,
mixcomwd_ping(); mixcomwd_ping();
break; break;
default: default:
return -ENOTTY; return -ENOIOCTLCMD;
} }
return 0; return 0;
} }
......
...@@ -255,7 +255,7 @@ static int pcwd_ioctl(struct inode *inode, struct file *file, ...@@ -255,7 +255,7 @@ static int pcwd_ioctl(struct inode *inode, struct file *file,
switch(cmd) { switch(cmd) {
default: default:
return -ENOTTY; return -ENOIOCTLCMD;
case WDIOC_GETSUPPORT: case WDIOC_GETSUPPORT:
if(copy_to_user((void*)arg, &ident, sizeof(ident))) if(copy_to_user((void*)arg, &ident, sizeof(ident)))
......
...@@ -180,7 +180,7 @@ static int sc1200wdt_ioctl(struct inode *inode, struct file *file, unsigned int ...@@ -180,7 +180,7 @@ static int sc1200wdt_ioctl(struct inode *inode, struct file *file, unsigned int
switch (cmd) { switch (cmd) {
default: default:
return -ENOTTY; /* Keep Pavel Machek amused ;) */ return -ENOIOCTLCMD; /* Keep Pavel Machek amused ;) */
case WDIOC_GETSUPPORT: case WDIOC_GETSUPPORT:
if (copy_to_user((struct watchdog_info *)arg, &ident, sizeof ident)) if (copy_to_user((struct watchdog_info *)arg, &ident, sizeof ident))
......
...@@ -170,7 +170,7 @@ static int scx200_wdt_ioctl(struct inode *inode, struct file *file, ...@@ -170,7 +170,7 @@ static int scx200_wdt_ioctl(struct inode *inode, struct file *file,
switch (cmd) { switch (cmd) {
default: default:
return -ENOTTY; return -ENOIOCTLCMD;
case WDIOC_GETSUPPORT: case WDIOC_GETSUPPORT:
if(copy_to_user((struct watchdog_info *)arg, &ident, if(copy_to_user((struct watchdog_info *)arg, &ident,
sizeof(ident))) sizeof(ident)))
......
...@@ -303,7 +303,7 @@ static int sh_wdt_ioctl(struct inode *inode, struct file *file, ...@@ -303,7 +303,7 @@ static int sh_wdt_ioctl(struct inode *inode, struct file *file,
return retval; return retval;
} }
default: default:
return -ENOTTY; return -ENOIOCTLCMD;
} }
return 0; return 0;
......
...@@ -170,7 +170,7 @@ static int softdog_ioctl(struct inode *inode, struct file *file, ...@@ -170,7 +170,7 @@ static int softdog_ioctl(struct inode *inode, struct file *file,
}; };
switch (cmd) { switch (cmd) {
default: default:
return -ENOTTY; return -ENOIOCTLCMD;
case WDIOC_GETSUPPORT: case WDIOC_GETSUPPORT:
if(copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))) if(copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident)))
return -EFAULT; return -EFAULT;
......
...@@ -184,7 +184,7 @@ wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -184,7 +184,7 @@ wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
} }
default: default:
return -ENOTTY; return -ENOIOCTLCMD;
} }
return 0; return 0;
} }
......
...@@ -182,7 +182,7 @@ static int wafwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd ...@@ -182,7 +182,7 @@ static int wafwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd
} }
default: default:
return -ENOTTY; return -ENOIOCTLCMD;
} }
return 0; return 0;
} }
......
...@@ -333,7 +333,7 @@ static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -333,7 +333,7 @@ static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
switch(cmd) switch(cmd)
{ {
default: default:
return -ENOTTY; return -ENOIOCTLCMD;
case WDIOC_GETSUPPORT: case WDIOC_GETSUPPORT:
return copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))?-EFAULT:0; return copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))?-EFAULT:0;
......
...@@ -269,7 +269,7 @@ static int wdt977_ioctl(struct inode *inode, struct file *file, ...@@ -269,7 +269,7 @@ static int wdt977_ioctl(struct inode *inode, struct file *file,
switch(cmd) switch(cmd)
{ {
default: default:
return -ENOTTY; return -ENOIOCTLCMD;
case WDIOC_GETSUPPORT: case WDIOC_GETSUPPORT:
return copy_to_user((struct watchdog_info *)arg, &ident, return copy_to_user((struct watchdog_info *)arg, &ident,
......
...@@ -319,7 +319,7 @@ static int wdtpci_ioctl(struct inode *inode, struct file *file, unsigned int cmd ...@@ -319,7 +319,7 @@ static int wdtpci_ioctl(struct inode *inode, struct file *file, unsigned int cmd
switch(cmd) switch(cmd)
{ {
default: default:
return -ENOTTY; return -ENOIOCTLCMD;
case WDIOC_GETSUPPORT: case WDIOC_GETSUPPORT:
return copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))?-EFAULT:0; return copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))?-EFAULT:0;
......
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