diff options
Diffstat (limited to 'drivers/watchdog/at91rm9200_wdt.c')
-rw-r--r-- | drivers/watchdog/at91rm9200_wdt.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/watchdog/at91rm9200_wdt.c b/drivers/watchdog/at91rm9200_wdt.c index bb79f649dc7e..2313f44144f8 100644 --- a/drivers/watchdog/at91rm9200_wdt.c +++ b/drivers/watchdog/at91rm9200_wdt.c | |||
@@ -137,23 +137,9 @@ static long at91_wdt_ioct(struct file *file, | |||
137 | int new_value; | 137 | int new_value; |
138 | 138 | ||
139 | switch (cmd) { | 139 | switch (cmd) { |
140 | case WDIOC_KEEPALIVE: | ||
141 | at91_wdt_reload(); /* pat the watchdog */ | ||
142 | return 0; | ||
143 | case WDIOC_GETSUPPORT: | 140 | case WDIOC_GETSUPPORT: |
144 | return copy_to_user(argp, &at91_wdt_info, | 141 | return copy_to_user(argp, &at91_wdt_info, |
145 | sizeof(at91_wdt_info)) ? -EFAULT : 0; | 142 | sizeof(at91_wdt_info)) ? -EFAULT : 0; |
146 | case WDIOC_SETTIMEOUT: | ||
147 | if (get_user(new_value, p)) | ||
148 | return -EFAULT; | ||
149 | if (at91_wdt_settimeout(new_value)) | ||
150 | return -EINVAL; | ||
151 | /* Enable new time value */ | ||
152 | at91_wdt_start(); | ||
153 | /* Return current value */ | ||
154 | return put_user(wdt_time, p); | ||
155 | case WDIOC_GETTIMEOUT: | ||
156 | return put_user(wdt_time, p); | ||
157 | case WDIOC_GETSTATUS: | 143 | case WDIOC_GETSTATUS: |
158 | case WDIOC_GETBOOTSTATUS: | 144 | case WDIOC_GETBOOTSTATUS: |
159 | return put_user(0, p); | 145 | return put_user(0, p); |
@@ -165,6 +151,20 @@ static long at91_wdt_ioct(struct file *file, | |||
165 | if (new_value & WDIOS_ENABLECARD) | 151 | if (new_value & WDIOS_ENABLECARD) |
166 | at91_wdt_start(); | 152 | at91_wdt_start(); |
167 | return 0; | 153 | return 0; |
154 | case WDIOC_KEEPALIVE: | ||
155 | at91_wdt_reload(); /* pat the watchdog */ | ||
156 | return 0; | ||
157 | case WDIOC_SETTIMEOUT: | ||
158 | if (get_user(new_value, p)) | ||
159 | return -EFAULT; | ||
160 | if (at91_wdt_settimeout(new_value)) | ||
161 | return -EINVAL; | ||
162 | /* Enable new time value */ | ||
163 | at91_wdt_start(); | ||
164 | /* Return current value */ | ||
165 | return put_user(wdt_time, p); | ||
166 | case WDIOC_GETTIMEOUT: | ||
167 | return put_user(wdt_time, p); | ||
168 | default: | 168 | default: |
169 | return -ENOTTY; | 169 | return -ENOTTY; |
170 | } | 170 | } |