diff options
Diffstat (limited to 'drivers/watchdog/pcwd_pci.c')
-rw-r--r-- | drivers/watchdog/pcwd_pci.c | 128 |
1 files changed, 64 insertions, 64 deletions
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 | ||