Skip to content

Commit

Permalink
rtc: vt8500: Use define instead of hardcoded value for status bit
Browse files Browse the repository at this point in the history
Fixes the vt8500 driver to use a define value for the isr
is-alarm bit.

Cc: Alexey Charkov <alchark@gmail.com>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
  • Loading branch information
Wolfram Sang authored and John Stultz committed Jul 2, 2011
1 parent daf54f1 commit 07187ee
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/rtc/rtc-vt8500.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
#define VT8500_RTC_CR_SM_SEC (1 << 3) /* 0: 1Hz/60, 1: 1Hz */
#define VT8500_RTC_CR_CALIB (1 << 4) /* Enable calibration */

#define VT8500_RTC_IS_ALARM (1 << 0) /* Alarm interrupt status */

struct vt8500_rtc {
void __iomem *regbase;
struct resource *res;
Expand All @@ -96,7 +98,7 @@ static irqreturn_t vt8500_rtc_irq(int irq, void *dev_id)

spin_unlock(&vt8500_rtc->lock);

if (isr & 1)
if (isr & VT8500_RTC_IS_ALARM)
events |= RTC_AF | RTC_IRQF;

rtc_update_irq(vt8500_rtc->rtc, 1, events);
Expand Down Expand Up @@ -161,8 +163,8 @@ static int vt8500_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
alrm->time.tm_sec = bcd2bin((alarm & TIME_SEC_MASK));

alrm->enabled = (alarm & ALARM_ENABLE_MASK) ? 1 : 0;
alrm->pending = (isr & VT8500_RTC_IS_ALARM) ? 1 : 0;

alrm->pending = (isr & 1) ? 1 : 0;
return rtc_valid_tm(&alrm->time);
}

Expand Down

0 comments on commit 07187ee

Please sign in to comment.