aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/sc1200wdt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/watchdog/sc1200wdt.c')
-rw-r--r--drivers/watchdog/sc1200wdt.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/watchdog/sc1200wdt.c b/drivers/watchdog/sc1200wdt.c
index 03e67fa4d689..f3bdc8227cc4 100644
--- a/drivers/watchdog/sc1200wdt.c
+++ b/drivers/watchdog/sc1200wdt.c
@@ -207,24 +207,6 @@ static long sc1200wdt_ioctl(struct file *file, unsigned int cmd,
207 case WDIOC_GETBOOTSTATUS: 207 case WDIOC_GETBOOTSTATUS:
208 return put_user(0, p); 208 return put_user(0, p);
209 209
210 case WDIOC_KEEPALIVE:
211 sc1200wdt_write_data(WDTO, timeout);
212 return 0;
213
214 case WDIOC_SETTIMEOUT:
215 if (get_user(new_timeout, p))
216 return -EFAULT;
217 /* the API states this is given in secs */
218 new_timeout /= 60;
219 if (new_timeout < 0 || new_timeout > MAX_TIMEOUT)
220 return -EINVAL;
221 timeout = new_timeout;
222 sc1200wdt_write_data(WDTO, timeout);
223 /* fall through and return the new timeout */
224
225 case WDIOC_GETTIMEOUT:
226 return put_user(timeout * 60, p);
227
228 case WDIOC_SETOPTIONS: 210 case WDIOC_SETOPTIONS:
229 { 211 {
230 int options, retval = -EINVAL; 212 int options, retval = -EINVAL;
@@ -244,6 +226,24 @@ static long sc1200wdt_ioctl(struct file *file, unsigned int cmd,
244 226
245 return retval; 227 return retval;
246 } 228 }
229 case WDIOC_KEEPALIVE:
230 sc1200wdt_write_data(WDTO, timeout);
231 return 0;
232
233 case WDIOC_SETTIMEOUT:
234 if (get_user(new_timeout, p))
235 return -EFAULT;
236 /* the API states this is given in secs */
237 new_timeout /= 60;
238 if (new_timeout < 0 || new_timeout > MAX_TIMEOUT)
239 return -EINVAL;
240 timeout = new_timeout;
241 sc1200wdt_write_data(WDTO, timeout);
242 /* fall through and return the new timeout */
243
244 case WDIOC_GETTIMEOUT:
245 return put_user(timeout * 60, p);
246
247 default: 247 default:
248 return -ENOTTY; 248 return -ENOTTY;
249 } 249 }