rtc: max77663: Use alrm->enabled flag to enable rtc alarm irq
Jinyoung Park [Tue, 6 Mar 2012 14:02:12 +0000 (23:02 +0900)]
Use alrm->enabled flag to enable rtc alarm irq in rtc_set_alrm function.

Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com>
Reviewed-on: http://git-master/r/88048
(cherry picked from commit 41e8686fc049fbdc0e83ecfa3f68da06ff813b99)

Change-Id: Ieb3b9863233b9d5bfc06459ef479c47a5e700d3b
Reviewed-on: http://git-master/r/89739
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

drivers/rtc/rtc-max77663.c

index 1354b83..874a2df 100644 (file)
@@ -444,10 +444,10 @@ static int max77663_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
        int ret;
 
        dev_dbg(rtc->dev, "rtc_set_alarm: "
-               "tm: %d-%02d-%02d %02d:%02d:%02d, wday=%d\n",
+               "tm: %d-%02d-%02d %02d:%02d:%02d, wday=%d [%s]\n",
                alrm->time.tm_year, alrm->time.tm_mon, alrm->time.tm_mday,
                alrm->time.tm_hour, alrm->time.tm_min, alrm->time.tm_sec,
-               alrm->time.tm_wday);
+               alrm->time.tm_wday, alrm->enabled?"enable":"disable");
 
        ret = max77663_rtc_tm_to_reg(rtc, buf, &alrm->time, 1);
        if (ret < 0) {
@@ -469,7 +469,7 @@ static int max77663_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
                return ret;
        }
 
-       ret = max77663_rtc_alarm_irq_enable(dev, 1);
+       ret = max77663_rtc_alarm_irq_enable(dev, alrm->enabled);
        if (ret < 0) {
                dev_err(rtc->dev,
                        "rtc_set_alarm: Failed to enable rtc alarm\n");