aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/wdt285.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/watchdog/wdt285.c b/drivers/watchdog/wdt285.c
index db362c34958b..191ea6302107 100644
--- a/drivers/watchdog/wdt285.c
+++ b/drivers/watchdog/wdt285.c
@@ -115,8 +115,8 @@ static int watchdog_release(struct inode *inode, struct file *file)
115 return 0; 115 return 0;
116} 116}
117 117
118static ssize_t watchdog_write(struct file *file, const char *data, 118static ssize_t watchdog_write(struct file *file, const char __user *data,
119 size_t len, loff_t *ppos) 119 size_t len, loff_t *ppos)
120{ 120{
121 /* 121 /*
122 * Refresh the timer. 122 * Refresh the timer.
@@ -133,21 +133,22 @@ static const struct watchdog_info ident = {
133}; 133};
134 134
135static long watchdog_ioctl(struct file *file, unsigned int cmd, 135static long watchdog_ioctl(struct file *file, unsigned int cmd,
136 unsigned long arg) 136 unsigned long arg)
137{ 137{
138 unsigned int new_margin; 138 unsigned int new_margin;
139 int __user *int_arg = (int __user *)arg;
139 int ret = -ENOTTY; 140 int ret = -ENOTTY;
140 141
141 switch (cmd) { 142 switch (cmd) {
142 case WDIOC_GETSUPPORT: 143 case WDIOC_GETSUPPORT:
143 ret = 0; 144 ret = 0;
144 if (copy_to_user((void *)arg, &ident, sizeof(ident))) 145 if (copy_to_user((void __user *)arg, &ident, sizeof(ident)))
145 ret = -EFAULT; 146 ret = -EFAULT;
146 break; 147 break;
147 148
148 case WDIOC_GETSTATUS: 149 case WDIOC_GETSTATUS:
149 case WDIOC_GETBOOTSTATUS: 150 case WDIOC_GETBOOTSTATUS:
150 ret = put_user(0, (int *)arg); 151 ret = put_user(0, int_arg);
151 break; 152 break;
152 153
153 case WDIOC_KEEPALIVE: 154 case WDIOC_KEEPALIVE:
@@ -156,7 +157,7 @@ static long watchdog_ioctl(struct file *file, unsigned int cmd,
156 break; 157 break;
157 158
158 case WDIOC_SETTIMEOUT: 159 case WDIOC_SETTIMEOUT:
159 ret = get_user(new_margin, (int *)arg); 160 ret = get_user(new_margin, int_arg);
160 if (ret) 161 if (ret)
161 break; 162 break;
162 163
@@ -171,7 +172,7 @@ static long watchdog_ioctl(struct file *file, unsigned int cmd,
171 watchdog_ping(); 172 watchdog_ping();
172 /* Fall */ 173 /* Fall */
173 case WDIOC_GETTIMEOUT: 174 case WDIOC_GETTIMEOUT:
174 ret = put_user(soft_margin, (int *)arg); 175 ret = put_user(soft_margin, int_arg);
175 break; 176 break;
176 } 177 }
177 return ret; 178 return ret;