diff options
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-dev.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c index f118252f3a9f..52e2743b04ec 100644 --- a/drivers/rtc/rtc-dev.c +++ b/drivers/rtc/rtc-dev.c | |||
@@ -422,6 +422,12 @@ done: | |||
422 | return err; | 422 | return err; |
423 | } | 423 | } |
424 | 424 | ||
425 | static int rtc_dev_fasync(int fd, struct file *file, int on) | ||
426 | { | ||
427 | struct rtc_device *rtc = file->private_data; | ||
428 | return fasync_helper(fd, file, on, &rtc->async_queue); | ||
429 | } | ||
430 | |||
425 | static int rtc_dev_release(struct inode *inode, struct file *file) | 431 | static int rtc_dev_release(struct inode *inode, struct file *file) |
426 | { | 432 | { |
427 | struct rtc_device *rtc = file->private_data; | 433 | struct rtc_device *rtc = file->private_data; |
@@ -434,16 +440,13 @@ static int rtc_dev_release(struct inode *inode, struct file *file) | |||
434 | if (rtc->ops->release) | 440 | if (rtc->ops->release) |
435 | rtc->ops->release(rtc->dev.parent); | 441 | rtc->ops->release(rtc->dev.parent); |
436 | 442 | ||
443 | if (file->f_flags & FASYNC) | ||
444 | rtc_dev_fasync(-1, file, 0); | ||
445 | |||
437 | clear_bit_unlock(RTC_DEV_BUSY, &rtc->flags); | 446 | clear_bit_unlock(RTC_DEV_BUSY, &rtc->flags); |
438 | return 0; | 447 | return 0; |
439 | } | 448 | } |
440 | 449 | ||
441 | static int rtc_dev_fasync(int fd, struct file *file, int on) | ||
442 | { | ||
443 | struct rtc_device *rtc = file->private_data; | ||
444 | return fasync_helper(fd, file, on, &rtc->async_queue); | ||
445 | } | ||
446 | |||
447 | static const struct file_operations rtc_dev_fops = { | 450 | static const struct file_operations rtc_dev_fops = { |
448 | .owner = THIS_MODULE, | 451 | .owner = THIS_MODULE, |
449 | .llseek = no_llseek, | 452 | .llseek = no_llseek, |