diff options
author | Wim Van Sebroeck <wim@iguana.be> | 2008-07-18 07:41:17 -0400 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2008-08-06 09:21:09 -0400 |
commit | 0c06090c9472db0525cb6fe229c3bea33bbbbb3c (patch) | |
tree | b01c21f6ef5649b6f0071dee4a55cb3ba236a7b8 /drivers/watchdog/eurotechwdt.c | |
parent | 5eb82498e3a6da8a979c48945e3c1a85c10ccc25 (diff) |
[WATCHDOG] Coding style - Indentation - part 2
This brings the watchdog drivers into line with coding style.
This patch takes cares of the indentation as described in chapter 1.
Main changes:
* Re-structure the ioctl switch call for all drivers as follows:
switch (cmd) {
case WDIOC_GETSUPPORT:
case WDIOC_GETSTATUS:
case WDIOC_GETBOOTSTATUS:
case WDIOC_GETTEMP:
case WDIOC_SETOPTIONS:
case WDIOC_KEEPALIVE:
case WDIOC_SETTIMEOUT:
case WDIOC_GETTIMEOUT:
case WDIOC_GETTIMELEFT:
default:
}
This to make the migration from the drivers to the uniform watchdog
device driver easier in the future.
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/eurotechwdt.c')
-rw-r--r-- | drivers/watchdog/eurotechwdt.c | 36 |
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 | ||