diff options
| -rw-r--r-- | drivers/watchdog/acquirewdt.c | 2 | ||||
| -rw-r--r-- | drivers/watchdog/geodewdt.c | 2 | ||||
| -rw-r--r-- | drivers/watchdog/pcwd_pci.c | 128 | ||||
| -rw-r--r-- | drivers/watchdog/pcwd_usb.c | 104 | ||||
| -rw-r--r-- | drivers/watchdog/sc1200wdt.c | 1 | ||||
| -rw-r--r-- | drivers/watchdog/sc520_wdt.c | 3 |
6 files changed, 119 insertions, 121 deletions
diff --git a/drivers/watchdog/acquirewdt.c b/drivers/watchdog/acquirewdt.c index 28d9057c9be6..340d1eeec16b 100644 --- a/drivers/watchdog/acquirewdt.c +++ b/drivers/watchdog/acquirewdt.c | |||
| @@ -169,7 +169,7 @@ static long acq_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
| 169 | return 0; | 169 | return 0; |
| 170 | 170 | ||
| 171 | case WDIOC_GETTIMEOUT: | 171 | case WDIOC_GETTIMEOUT: |
| 172 | return put_user(WATCHDOG_HEARTBEAT, p); | 172 | return put_user(WATCHDOG_HEARTBEAT, p); |
| 173 | 173 | ||
| 174 | case WDIOC_SETOPTIONS: | 174 | case WDIOC_SETOPTIONS: |
| 175 | { | 175 | { |
diff --git a/drivers/watchdog/geodewdt.c b/drivers/watchdog/geodewdt.c index a41f57ce581a..74c00698801d 100644 --- a/drivers/watchdog/geodewdt.c +++ b/drivers/watchdog/geodewdt.c | |||
| @@ -149,7 +149,7 @@ geodewdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |||
| 149 | .identity = WATCHDOG_NAME, | 149 | .identity = WATCHDOG_NAME, |
| 150 | }; | 150 | }; |
| 151 | 151 | ||
| 152 | switch(cmd) { | 152 | switch (cmd) { |
| 153 | case WDIOC_GETSUPPORT: | 153 | case WDIOC_GETSUPPORT: |
| 154 | return copy_to_user(argp, &ident, | 154 | return copy_to_user(argp, &ident, |
| 155 | sizeof(ident)) ? -EFAULT : 0; | 155 | sizeof(ident)) ? -EFAULT : 0; |
diff --git a/drivers/watchdog/pcwd_pci.c b/drivers/watchdog/pcwd_pci.c index 67d90810c6e9..7f500ee4ee8a 100644 --- a/drivers/watchdog/pcwd_pci.c +++ b/drivers/watchdog/pcwd_pci.c | |||
| @@ -470,90 +470,90 @@ static long pcipcwd_ioctl(struct file *file, unsigned int cmd, | |||
| 470 | }; | 470 | }; |
| 471 | 471 | ||
| 472 | switch (cmd) { | 472 | switch (cmd) { |
| 473 | case WDIOC_GETSUPPORT: | 473 | case WDIOC_GETSUPPORT: |
| 474 | return copy_to_user(argp, &ident, | 474 | return copy_to_user(argp, &ident, |
| 475 | sizeof (ident)) ? -EFAULT : 0; | 475 | sizeof (ident)) ? -EFAULT : 0; |
| 476 | 476 | ||
| 477 | case WDIOC_GETSTATUS: | 477 | case WDIOC_GETSTATUS: |
| 478 | { | 478 | { |
| 479 | int status; | 479 | int status; |
| 480 | pcipcwd_get_status(&status); | 480 | pcipcwd_get_status(&status); |
| 481 | return put_user(status, p); | 481 | return put_user(status, p); |
| 482 | } | 482 | } |
| 483 | 483 | ||
| 484 | case WDIOC_GETBOOTSTATUS: | 484 | case WDIOC_GETBOOTSTATUS: |
| 485 | return put_user(pcipcwd_private.boot_status, p); | 485 | return put_user(pcipcwd_private.boot_status, p); |
| 486 | 486 | ||
| 487 | case WDIOC_GETTEMP: | 487 | case WDIOC_GETTEMP: |
| 488 | { | 488 | { |
| 489 | int temperature; | 489 | int temperature; |
| 490 | 490 | ||
| 491 | if (pcipcwd_get_temperature(&temperature)) | 491 | if (pcipcwd_get_temperature(&temperature)) |
| 492 | return -EFAULT; | 492 | return -EFAULT; |
| 493 | 493 | ||
| 494 | return put_user(temperature, p); | 494 | return put_user(temperature, p); |
| 495 | } | 495 | } |
| 496 | |||
| 497 | case WDIOC_KEEPALIVE: | ||
| 498 | pcipcwd_keepalive(); | ||
| 499 | return 0; | ||
| 500 | 496 | ||
| 501 | case WDIOC_SETOPTIONS: | 497 | case WDIOC_KEEPALIVE: |
| 502 | { | 498 | pcipcwd_keepalive(); |
| 503 | int new_options, retval = -EINVAL; | 499 | return 0; |
| 504 | 500 | ||
| 505 | if (get_user (new_options, p)) | 501 | case WDIOC_SETOPTIONS: |
| 506 | return -EFAULT; | 502 | { |
| 503 | int new_options, retval = -EINVAL; | ||
| 507 | 504 | ||
| 508 | if (new_options & WDIOS_DISABLECARD) { | 505 | if (get_user (new_options, p)) |
| 509 | if (pcipcwd_stop()) | 506 | return -EFAULT; |
| 510 | return -EIO; | ||
| 511 | retval = 0; | ||
| 512 | } | ||
| 513 | 507 | ||
| 514 | if (new_options & WDIOS_ENABLECARD) { | 508 | if (new_options & WDIOS_DISABLECARD) { |
| 515 | if (pcipcwd_start()) | 509 | if (pcipcwd_stop()) |
| 516 | return -EIO; | 510 | return -EIO; |
| 517 | retval = 0; | 511 | retval = 0; |
| 518 | } | 512 | } |
| 519 | 513 | ||
| 520 | if (new_options & WDIOS_TEMPPANIC) { | 514 | if (new_options & WDIOS_ENABLECARD) { |
| 521 | temp_panic = 1; | 515 | if (pcipcwd_start()) |
| 522 | retval = 0; | 516 | return -EIO; |
| 523 | } | 517 | retval = 0; |
| 518 | } | ||
| 524 | 519 | ||
| 525 | return retval; | 520 | if (new_options & WDIOS_TEMPPANIC) { |
| 521 | temp_panic = 1; | ||
| 522 | retval = 0; | ||
| 526 | } | 523 | } |
| 527 | 524 | ||
| 528 | case WDIOC_SETTIMEOUT: | 525 | return retval; |
| 529 | { | 526 | } |
| 530 | int new_heartbeat; | ||
| 531 | 527 | ||
| 532 | if (get_user(new_heartbeat, p)) | 528 | case WDIOC_SETTIMEOUT: |
| 533 | return -EFAULT; | 529 | { |
| 530 | int new_heartbeat; | ||
| 534 | 531 | ||
| 535 | if (pcipcwd_set_heartbeat(new_heartbeat)) | 532 | if (get_user(new_heartbeat, p)) |
| 536 | return -EINVAL; | 533 | return -EFAULT; |
| 537 | 534 | ||
| 538 | pcipcwd_keepalive(); | 535 | if (pcipcwd_set_heartbeat(new_heartbeat)) |
| 539 | /* Fall */ | 536 | return -EINVAL; |
| 540 | } | ||
| 541 | 537 | ||
| 542 | case WDIOC_GETTIMEOUT: | 538 | pcipcwd_keepalive(); |
| 543 | return put_user(heartbeat, p); | 539 | /* Fall */ |
| 540 | } | ||
| 544 | 541 | ||
| 545 | case WDIOC_GETTIMELEFT: | 542 | case WDIOC_GETTIMEOUT: |
| 546 | { | 543 | return put_user(heartbeat, p); |
| 547 | int time_left; | ||
| 548 | 544 | ||
| 549 | if (pcipcwd_get_timeleft(&time_left)) | 545 | case WDIOC_GETTIMELEFT: |
| 550 | return -EFAULT; | 546 | { |
| 547 | int time_left; | ||
| 551 | 548 | ||
| 552 | return put_user(time_left, p); | 549 | if (pcipcwd_get_timeleft(&time_left)) |
| 553 | } | 550 | return -EFAULT; |
| 551 | |||
| 552 | return put_user(time_left, p); | ||
| 553 | } | ||
| 554 | 554 | ||
| 555 | default: | 555 | default: |
| 556 | return -ENOTTY; | 556 | return -ENOTTY; |
| 557 | } | 557 | } |
| 558 | } | 558 | } |
| 559 | 559 | ||
diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c index bc399cf65cf7..8194435052c8 100644 --- a/drivers/watchdog/pcwd_usb.c +++ b/drivers/watchdog/pcwd_usb.c | |||
| @@ -382,77 +382,77 @@ static long usb_pcwd_ioctl(struct file *file, unsigned int cmd, | |||
| 382 | }; | 382 | }; |
| 383 | 383 | ||
| 384 | switch (cmd) { | 384 | switch (cmd) { |
| 385 | case WDIOC_GETSUPPORT: | 385 | case WDIOC_GETSUPPORT: |
| 386 | return copy_to_user(argp, &ident, | 386 | return copy_to_user(argp, &ident, |
| 387 | sizeof (ident)) ? -EFAULT : 0; | 387 | sizeof (ident)) ? -EFAULT : 0; |
| 388 | 388 | ||
| 389 | case WDIOC_GETSTATUS: | 389 | case WDIOC_GETSTATUS: |
| 390 | case WDIOC_GETBOOTSTATUS: | 390 | case WDIOC_GETBOOTSTATUS: |
| 391 | return put_user(0, p); | 391 | return put_user(0, p); |
| 392 | 392 | ||
| 393 | case WDIOC_GETTEMP: | 393 | case WDIOC_GETTEMP: |
| 394 | { | 394 | { |
| 395 | int temperature; | 395 | int temperature; |
| 396 | 396 | ||
| 397 | if (usb_pcwd_get_temperature(usb_pcwd_device, &temperature)) | 397 | if (usb_pcwd_get_temperature(usb_pcwd_device, &temperature)) |
| 398 | return -EFAULT; | 398 | return -EFAULT; |
| 399 | 399 | ||
| 400 | return put_user(temperature, p); | 400 | return put_user(temperature, p); |
| 401 | } | 401 | } |
| 402 | 402 | ||
| 403 | case WDIOC_KEEPALIVE: | 403 | case WDIOC_KEEPALIVE: |
| 404 | usb_pcwd_keepalive(usb_pcwd_device); | 404 | usb_pcwd_keepalive(usb_pcwd_device); |
| 405 | return 0; | 405 | return 0; |
| 406 | 406 | ||
| 407 | case WDIOC_SETOPTIONS: | 407 | case WDIOC_SETOPTIONS: |
| 408 | { | 408 | { |
| 409 | int new_options, retval = -EINVAL; | 409 | int new_options, retval = -EINVAL; |
| 410 | 410 | ||
| 411 | if (get_user (new_options, p)) | 411 | if (get_user (new_options, p)) |
| 412 | return -EFAULT; | 412 | return -EFAULT; |
| 413 | 413 | ||
| 414 | if (new_options & WDIOS_DISABLECARD) { | 414 | if (new_options & WDIOS_DISABLECARD) { |
| 415 | usb_pcwd_stop(usb_pcwd_device); | 415 | usb_pcwd_stop(usb_pcwd_device); |
| 416 | retval = 0; | 416 | retval = 0; |
| 417 | } | 417 | } |
| 418 | |||
| 419 | if (new_options & WDIOS_ENABLECARD) { | ||
| 420 | usb_pcwd_start(usb_pcwd_device); | ||
| 421 | retval = 0; | ||
| 422 | } | ||
| 423 | 418 | ||
| 424 | return retval; | 419 | if (new_options & WDIOS_ENABLECARD) { |
| 420 | usb_pcwd_start(usb_pcwd_device); | ||
| 421 | retval = 0; | ||
| 425 | } | 422 | } |
| 426 | 423 | ||
| 427 | case WDIOC_SETTIMEOUT: | 424 | return retval; |
| 428 | { | 425 | } |
| 429 | int new_heartbeat; | ||
| 430 | 426 | ||
| 431 | if (get_user(new_heartbeat, p)) | 427 | case WDIOC_SETTIMEOUT: |
| 432 | return -EFAULT; | 428 | { |
| 429 | int new_heartbeat; | ||
| 433 | 430 | ||
| 434 | if (usb_pcwd_set_heartbeat(usb_pcwd_device, new_heartbeat)) | 431 | if (get_user(new_heartbeat, p)) |
| 435 | return -EINVAL; | 432 | return -EFAULT; |
| 436 | 433 | ||
| 437 | usb_pcwd_keepalive(usb_pcwd_device); | 434 | if (usb_pcwd_set_heartbeat(usb_pcwd_device, new_heartbeat)) |
| 438 | /* Fall */ | 435 | return -EINVAL; |
| 439 | } | ||
| 440 | 436 | ||
| 441 | case WDIOC_GETTIMEOUT: | 437 | usb_pcwd_keepalive(usb_pcwd_device); |
| 442 | return put_user(heartbeat, p); | 438 | /* Fall */ |
| 439 | } | ||
| 443 | 440 | ||
| 444 | case WDIOC_GETTIMELEFT: | 441 | case WDIOC_GETTIMEOUT: |
| 445 | { | 442 | return put_user(heartbeat, p); |
| 446 | int time_left; | ||
| 447 | 443 | ||
| 448 | if (usb_pcwd_get_timeleft(usb_pcwd_device, &time_left)) | 444 | case WDIOC_GETTIMELEFT: |
| 449 | return -EFAULT; | 445 | { |
| 446 | int time_left; | ||
| 450 | 447 | ||
| 451 | return put_user(time_left, p); | 448 | if (usb_pcwd_get_timeleft(usb_pcwd_device, &time_left)) |
| 452 | } | 449 | return -EFAULT; |
| 450 | |||
| 451 | return put_user(time_left, p); | ||
| 452 | } | ||
| 453 | 453 | ||
| 454 | default: | 454 | default: |
| 455 | return -ENOTTY; | 455 | return -ENOTTY; |
| 456 | } | 456 | } |
| 457 | } | 457 | } |
| 458 | 458 | ||
diff --git a/drivers/watchdog/sc1200wdt.c b/drivers/watchdog/sc1200wdt.c index 621ebad56d86..03e67fa4d689 100644 --- a/drivers/watchdog/sc1200wdt.c +++ b/drivers/watchdog/sc1200wdt.c | |||
| @@ -196,7 +196,6 @@ static long sc1200wdt_ioctl(struct file *file, unsigned int cmd, | |||
| 196 | }; | 196 | }; |
| 197 | 197 | ||
| 198 | switch (cmd) { | 198 | switch (cmd) { |
| 199 | |||
| 200 | case WDIOC_GETSUPPORT: | 199 | case WDIOC_GETSUPPORT: |
| 201 | if (copy_to_user(argp, &ident, sizeof ident)) | 200 | if (copy_to_user(argp, &ident, sizeof ident)) |
| 202 | return -EFAULT; | 201 | return -EFAULT; |
diff --git a/drivers/watchdog/sc520_wdt.c b/drivers/watchdog/sc520_wdt.c index 01de239f49e8..1d5ba15dec63 100644 --- a/drivers/watchdog/sc520_wdt.c +++ b/drivers/watchdog/sc520_wdt.c | |||
| @@ -290,8 +290,7 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
| 290 | .identity = "SC520", | 290 | .identity = "SC520", |
| 291 | }; | 291 | }; |
| 292 | 292 | ||
| 293 | switch (cmd) | 293 | switch (cmd) { |
| 294 | { | ||
| 295 | default: | 294 | default: |
| 296 | return -ENOTTY; | 295 | return -ENOTTY; |
| 297 | case WDIOC_GETSUPPORT: | 296 | case WDIOC_GETSUPPORT: |
