提交 619a8a2b 编写于 作者: A Alan Cox 提交者: Wim Van Sebroeck

[WATCHDOG 38/57] stg7240_wdt: unlocked_ioctl

Review and switch to unlocked_ioctl
Signed-off-by: NAlan Cox <alan@redhat.com>
Signed-off-by: NWim Van Sebroeck <wim@iguana.be>
上级 1780de41
...@@ -27,10 +27,10 @@ ...@@ -27,10 +27,10 @@
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/watchdog.h> #include <linux/watchdog.h>
#include <linux/io.h>
#include <linux/uaccess.h>
#include <asm/atomic.h> #include <asm/atomic.h>
#include <asm/io.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/uaccess.h>
#define SBC7240_PREFIX "sbc7240_wdt: " #define SBC7240_PREFIX "sbc7240_wdt: "
...@@ -159,7 +159,7 @@ static int fop_close(struct inode *inode, struct file *file) ...@@ -159,7 +159,7 @@ static int fop_close(struct inode *inode, struct file *file)
return 0; return 0;
} }
static struct watchdog_info ident = { static const struct watchdog_info ident = {
.options = WDIOF_KEEPALIVEPING| .options = WDIOF_KEEPALIVEPING|
WDIOF_SETTIMEOUT| WDIOF_SETTIMEOUT|
WDIOF_MAGICCLOSE, WDIOF_MAGICCLOSE,
...@@ -168,14 +168,12 @@ static struct watchdog_info ident = { ...@@ -168,14 +168,12 @@ static struct watchdog_info ident = {
}; };
static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
unsigned long arg)
{ {
switch (cmd) { switch (cmd) {
case WDIOC_GETSUPPORT: case WDIOC_GETSUPPORT:
return copy_to_user return copy_to_user((void __user *)arg, &ident, sizeof(ident))
((void __user *)arg, &ident, sizeof(ident)) ? -EFAULT : 0;
? -EFAULT : 0;
case WDIOC_GETSTATUS: case WDIOC_GETSTATUS:
case WDIOC_GETBOOTSTATUS: case WDIOC_GETBOOTSTATUS:
return put_user(0, (int __user *)arg); return put_user(0, (int __user *)arg);
...@@ -225,7 +223,7 @@ static const struct file_operations wdt_fops = { ...@@ -225,7 +223,7 @@ static const struct file_operations wdt_fops = {
.write = fop_write, .write = fop_write,
.open = fop_open, .open = fop_open,
.release = fop_close, .release = fop_close,
.ioctl = fop_ioctl, .unlocked_ioctl = fop_ioctl,
}; };
static struct miscdevice wdt_miscdev = { static struct miscdevice wdt_miscdev = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册