Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 288783
b: refs/heads/master
c: 41c7f74
h: refs/heads/master
i:
  288781: 93a3337
  288779: d60dfd6
  288775: b8ef356
  288767: 8bd0fe7
v: v3
  • Loading branch information
Rabin Vincent authored and John Stultz committed Jan 27, 2012
1 parent 15fcbb6 commit 754389c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 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: 5f9679d29c7959445d4af1eb85ee55e4ebad4a93
refs/heads/master: 41c7f7424259ff11009449f87c95656f69f9b186
15 changes: 13 additions & 2 deletions trunk/drivers/rtc/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,14 @@ static int rtc_timer_enqueue(struct rtc_device *rtc, struct rtc_timer *timer)
return 0;
}

static void rtc_alarm_disable(struct rtc_device *rtc)
{
if (!rtc->ops || !rtc->ops->alarm_irq_enable)
return;

rtc->ops->alarm_irq_enable(rtc->dev.parent, false);
}

/**
* rtc_timer_remove - Removes a rtc_timer from the rtc_device timerqueue
* @rtc rtc device
Expand All @@ -797,8 +805,10 @@ static void rtc_timer_remove(struct rtc_device *rtc, struct rtc_timer *timer)
struct rtc_wkalrm alarm;
int err;
next = timerqueue_getnext(&rtc->timerqueue);
if (!next)
if (!next) {
rtc_alarm_disable(rtc);
return;
}
alarm.time = rtc_ktime_to_tm(next->expires);
alarm.enabled = 1;
err = __rtc_set_alarm(rtc, &alarm);
Expand Down Expand Up @@ -860,7 +870,8 @@ void rtc_timer_do_work(struct work_struct *work)
err = __rtc_set_alarm(rtc, &alarm);
if (err == -ETIME)
goto again;
}
} else
rtc_alarm_disable(rtc);

mutex_unlock(&rtc->ops_lock);
}
Expand Down

0 comments on commit 754389c

Please sign in to comment.