aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/eurotechwdt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/watchdog/eurotechwdt.c')
-rw-r--r--drivers/watchdog/eurotechwdt.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/watchdog/eurotechwdt.c b/drivers/watchdog/eurotechwdt.c
index b94e6ef4c7a7..96250118fd7c 100644
--- a/drivers/watchdog/eurotechwdt.c
+++ b/drivers/watchdog/eurotechwdt.c
@@ -249,9 +249,6 @@ static long eurwdt_ioctl(struct file *file,
249 int options, retval = -EINVAL; 249 int options, retval = -EINVAL;
250 250
251 switch (cmd) { 251 switch (cmd) {
252 default:
253 return -ENOTTY;
254
255 case WDIOC_GETSUPPORT: 252 case WDIOC_GETSUPPORT:
256 return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0; 253 return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
257 254
@@ -259,6 +256,22 @@ static long eurwdt_ioctl(struct file *file,
259 case WDIOC_GETBOOTSTATUS: 256 case WDIOC_GETBOOTSTATUS:
260 return put_user(0, p); 257 return put_user(0, p);
261 258
259 case WDIOC_SETOPTIONS:
260 if (get_user(options, p))
261 return -EFAULT;
262 spin_lock(&eurwdt_lock);
263 if (options & WDIOS_DISABLECARD) {
264 eurwdt_disable_timer();
265 retval = 0;
266 }
267 if (options & WDIOS_ENABLECARD) {
268 eurwdt_activate_timer();
269 eurwdt_ping();
270 retval = 0;
271 }
272 spin_unlock(&eurwdt_lock);
273 return retval;
274
262 case WDIOC_KEEPALIVE: 275 case WDIOC_KEEPALIVE:
263 spin_lock(&eurwdt_lock); 276 spin_lock(&eurwdt_lock);
264 eurwdt_ping(); 277 eurwdt_ping();
@@ -282,21 +295,8 @@ static long eurwdt_ioctl(struct file *file,
282 case WDIOC_GETTIMEOUT: 295 case WDIOC_GETTIMEOUT:
283 return put_user(eurwdt_timeout, p); 296 return put_user(eurwdt_timeout, p);
284 297
285 case WDIOC_SETOPTIONS: 298 default:
286 if (get_user(options, p)) 299 return -ENOTTY;
287 return -EFAULT;
288 spin_lock(&eurwdt_lock);
289 if (options & WDIOS_DISABLECARD) {
290 eurwdt_disable_timer();
291 retval = 0;
292 }
293 if (options & WDIOS_ENABLECARD) {
294 eurwdt_activate_timer();
295 eurwdt_ping();
296 retval = 0;
297 }
298 spin_unlock(&eurwdt_lock);
299 return retval;
300 } 300 }
301} 301}
302 302