diff options
Diffstat (limited to 'drivers/rtc/rtc-m41t80.c')
-rw-r--r-- | drivers/rtc/rtc-m41t80.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c index 60fe266f0f49..6dc4e6241418 100644 --- a/drivers/rtc/rtc-m41t80.c +++ b/drivers/rtc/rtc-m41t80.c | |||
@@ -595,10 +595,6 @@ static void wdt_disable(void) | |||
595 | static ssize_t wdt_write(struct file *file, const char __user *buf, | 595 | static ssize_t wdt_write(struct file *file, const char __user *buf, |
596 | size_t count, loff_t *ppos) | 596 | size_t count, loff_t *ppos) |
597 | { | 597 | { |
598 | /* Can't seek (pwrite) on this device | ||
599 | if (ppos != &file->f_pos) | ||
600 | return -ESPIPE; | ||
601 | */ | ||
602 | if (count) { | 598 | if (count) { |
603 | wdt_ping(); | 599 | wdt_ping(); |
604 | return 1; | 600 | return 1; |
@@ -623,7 +619,7 @@ static ssize_t wdt_read(struct file *file, char __user *buf, | |||
623 | * according to their available features. We only actually usefully support | 619 | * according to their available features. We only actually usefully support |
624 | * querying capabilities and current status. | 620 | * querying capabilities and current status. |
625 | */ | 621 | */ |
626 | static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | 622 | static int wdt_ioctl(struct file *file, unsigned int cmd, |
627 | unsigned long arg) | 623 | unsigned long arg) |
628 | { | 624 | { |
629 | int new_margin, rv; | 625 | int new_margin, rv; |
@@ -676,6 +672,18 @@ static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |||
676 | return -ENOTTY; | 672 | return -ENOTTY; |
677 | } | 673 | } |
678 | 674 | ||
675 | static long wdt_unlocked_ioctl(struct file *file, unsigned int cmd, | ||
676 | unsigned long arg) | ||
677 | { | ||
678 | int ret; | ||
679 | |||
680 | lock_kernel(); | ||
681 | ret = wdt_ioctl(file, cmd, arg); | ||
682 | unlock_kernel(); | ||
683 | |||
684 | return ret; | ||
685 | } | ||
686 | |||
679 | /** | 687 | /** |
680 | * wdt_open: | 688 | * wdt_open: |
681 | * @inode: inode of device | 689 | * @inode: inode of device |
@@ -695,7 +703,7 @@ static int wdt_open(struct inode *inode, struct file *file) | |||
695 | */ | 703 | */ |
696 | wdt_is_open = 1; | 704 | wdt_is_open = 1; |
697 | unlock_kernel(); | 705 | unlock_kernel(); |
698 | return 0; | 706 | return nonseekable_open(inode, file); |
699 | } | 707 | } |
700 | return -ENODEV; | 708 | return -ENODEV; |
701 | } | 709 | } |
@@ -736,7 +744,7 @@ static int wdt_notify_sys(struct notifier_block *this, unsigned long code, | |||
736 | static const struct file_operations wdt_fops = { | 744 | static const struct file_operations wdt_fops = { |
737 | .owner = THIS_MODULE, | 745 | .owner = THIS_MODULE, |
738 | .read = wdt_read, | 746 | .read = wdt_read, |
739 | .ioctl = wdt_ioctl, | 747 | .unlocked_ioctl = wdt_unlocked_ioctl, |
740 | .write = wdt_write, | 748 | .write = wdt_write, |
741 | .open = wdt_open, | 749 | .open = wdt_open, |
742 | .release = wdt_release, | 750 | .release = wdt_release, |