diff options
Diffstat (limited to 'drivers/rtc/rtc-dev.c')
-rw-r--r-- | drivers/rtc/rtc-dev.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c index 35dcc06eb3e2..52e2743b04ec 100644 --- a/drivers/rtc/rtc-dev.c +++ b/drivers/rtc/rtc-dev.c | |||
@@ -403,11 +403,14 @@ static long rtc_dev_ioctl(struct file *file, | |||
403 | 403 | ||
404 | #ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL | 404 | #ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL |
405 | case RTC_UIE_OFF: | 405 | case RTC_UIE_OFF: |
406 | mutex_unlock(&rtc->ops_lock); | ||
406 | clear_uie(rtc); | 407 | clear_uie(rtc); |
407 | break; | 408 | return 0; |
408 | 409 | ||
409 | case RTC_UIE_ON: | 410 | case RTC_UIE_ON: |
411 | mutex_unlock(&rtc->ops_lock); | ||
410 | err = set_uie(rtc); | 412 | err = set_uie(rtc); |
413 | return err; | ||
411 | #endif | 414 | #endif |
412 | default: | 415 | default: |
413 | err = -ENOTTY; | 416 | err = -ENOTTY; |
@@ -419,6 +422,12 @@ done: | |||
419 | return err; | 422 | return err; |
420 | } | 423 | } |
421 | 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 | |||
422 | static int rtc_dev_release(struct inode *inode, struct file *file) | 431 | static int rtc_dev_release(struct inode *inode, struct file *file) |
423 | { | 432 | { |
424 | struct rtc_device *rtc = file->private_data; | 433 | struct rtc_device *rtc = file->private_data; |
@@ -431,16 +440,13 @@ static int rtc_dev_release(struct inode *inode, struct file *file) | |||
431 | if (rtc->ops->release) | 440 | if (rtc->ops->release) |
432 | rtc->ops->release(rtc->dev.parent); | 441 | rtc->ops->release(rtc->dev.parent); |
433 | 442 | ||
443 | if (file->f_flags & FASYNC) | ||
444 | rtc_dev_fasync(-1, file, 0); | ||
445 | |||
434 | clear_bit_unlock(RTC_DEV_BUSY, &rtc->flags); | 446 | clear_bit_unlock(RTC_DEV_BUSY, &rtc->flags); |
435 | return 0; | 447 | return 0; |
436 | } | 448 | } |
437 | 449 | ||
438 | static int rtc_dev_fasync(int fd, struct file *file, int on) | ||
439 | { | ||
440 | struct rtc_device *rtc = file->private_data; | ||
441 | return fasync_helper(fd, file, on, &rtc->async_queue); | ||
442 | } | ||
443 | |||
444 | static const struct file_operations rtc_dev_fops = { | 450 | static const struct file_operations rtc_dev_fops = { |
445 | .owner = THIS_MODULE, | 451 | .owner = THIS_MODULE, |
446 | .llseek = no_llseek, | 452 | .llseek = no_llseek, |