Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 232290
b: refs/heads/master
c: d5553a5
h: refs/heads/master
v: v3
  • Loading branch information
John Stultz authored and Thomas Gleixner committed Jan 21, 2011
1 parent a4b6732 commit d5e04b8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: aa0be0f4659f91f31e45adc422b1788cb36ffddc
refs/heads/master: d5553a556165535337ece8592f066407c62eec2e
12 changes: 9 additions & 3 deletions trunk/drivers/rtc/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,18 @@ int rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
err = mutex_lock_interruptible(&rtc->ops_lock);
if (err)
return err;
alarm->enabled = rtc->aie_timer.enabled;
if (alarm->enabled)
if (rtc->ops == NULL)
err = -ENODEV;
else if (!rtc->ops->read_alarm)
err = -EINVAL;
else {
memset(alarm, 0, sizeof(struct rtc_wkalrm));
alarm->enabled = rtc->aie_timer.enabled;
alarm->time = rtc_ktime_to_tm(rtc->aie_timer.node.expires);
}
mutex_unlock(&rtc->ops_lock);

return 0;
return err;
}
EXPORT_SYMBOL_GPL(rtc_read_alarm);

Expand Down

0 comments on commit d5e04b8

Please sign in to comment.