aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/shwdt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/watchdog/shwdt.c')
-rw-r--r--drivers/watchdog/shwdt.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/watchdog/shwdt.c b/drivers/watchdog/shwdt.c
index 60f0036aaca6..824125adf90a 100644
--- a/drivers/watchdog/shwdt.c
+++ b/drivers/watchdog/shwdt.c
@@ -351,20 +351,6 @@ static long sh_wdt_ioctl(struct file *file, unsigned int cmd,
351 case WDIOC_GETSTATUS: 351 case WDIOC_GETSTATUS:
352 case WDIOC_GETBOOTSTATUS: 352 case WDIOC_GETBOOTSTATUS:
353 return put_user(0, (int *)arg); 353 return put_user(0, (int *)arg);
354 case WDIOC_KEEPALIVE:
355 sh_wdt_keepalive();
356 return 0;
357 case WDIOC_SETTIMEOUT:
358 if (get_user(new_heartbeat, (int *)arg))
359 return -EFAULT;
360
361 if (sh_wdt_set_heartbeat(new_heartbeat))
362 return -EINVAL;
363
364 sh_wdt_keepalive();
365 /* Fall */
366 case WDIOC_GETTIMEOUT:
367 return put_user(heartbeat, (int *)arg);
368 case WDIOC_SETOPTIONS: 354 case WDIOC_SETOPTIONS:
369 if (get_user(options, (int *)arg)) 355 if (get_user(options, (int *)arg))
370 return -EFAULT; 356 return -EFAULT;
@@ -380,6 +366,20 @@ static long sh_wdt_ioctl(struct file *file, unsigned int cmd,
380 } 366 }
381 367
382 return retval; 368 return retval;
369 case WDIOC_KEEPALIVE:
370 sh_wdt_keepalive();
371 return 0;
372 case WDIOC_SETTIMEOUT:
373 if (get_user(new_heartbeat, (int *)arg))
374 return -EFAULT;
375
376 if (sh_wdt_set_heartbeat(new_heartbeat))
377 return -EINVAL;
378
379 sh_wdt_keepalive();
380 /* Fall */
381 case WDIOC_GETTIMEOUT:
382 return put_user(heartbeat, (int *)arg);
383 default: 383 default:
384 return -ENOTTY; 384 return -ENOTTY;
385 } 385 }