rtc-sa1100 correctly reports rtc_wkalrm.enabled
PATCH 1/1 rtc-sa1100 correctly reports rtc_wkalrm.enabled
This fixes one bug in the SA-1100/PXA RTC support: read_alarm() isn't reporting whether the alarm is enabled. This causes a small regression, with procfs no longer reporting that state.
Signed-off-by David Brownell <[email protected]>
---
Note there are still bugs with how this driver handles this "enabled" flag when it _sets_ alarms. I'm told the hh.org tree already merged this particular patch.
drivers/rtc/rtc-sa1100.c +5 -1
@@ -263,8 +263,12 @@ static int sa1100_rtc_set_time(struct destatic int sa1100_rtc_read_alarm (struct device *dev,struct rtc_wkalrm *alrm) { +u32 rtsr; +memcpy (&alrm->time, &rtc_alarm,sizeof (struct rtc_time )); - alrm->pending =RTSR &RTSR_AL ?1 :0 ; + rtsr =RTSR ; + alrm->enabled = (rtsr &RTSR_ALE ) ?1 :0 ; + alrm->pending = (rtsr &RTSR_AL ) ?1 :0 ;return 0 ; }