rtc: max77663: fix alarm reading bug
Daniel Fu [Wed, 5 Sep 2012 03:45:04 +0000 (11:45 +0800)]
When reading alarm of RTC-max77663, it didn't set alrm->enabled correctly,
if irq is masked, means disable alarm, alrm->enabled should be set to 0,
else it should be 1.

Change-Id: Id0b1ffd9a816643712f33624d7d52cbe7b66b3c3
Signed-off-by: Daniel Fu <danifu@nvidia.com>
Reviewed-on: http://git-master/r/129593
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

drivers/rtc/rtc-max77663.c

index a84dcc7..d6dac76 100644 (file)
@@ -432,9 +432,9 @@ static int max77663_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
                alrm->time.tm_wday);
 
        if (rtc->irq_mask & RTC_IRQ_ALARM1_MASK)
-               alrm->enabled = 1;
-       else
                alrm->enabled = 0;
+       else
+               alrm->enabled = 1;
 
        return 0;
 }