]> err.no Git - linux-2.6/commitdiff
Blackfin RTC driver: read_alarm() checks the enabled field, not the pending field.
authorMike Frysinger <michael.frysinger@analog.com>
Wed, 6 Feb 2008 09:38:49 +0000 (01:38 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 6 Feb 2008 18:41:14 +0000 (10:41 -0800)
also, dont bother using memcpy since we can just do an assignment of the same structure.

Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Acked-by: Alessandro Zummo <alessandro.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/rtc/rtc-bfin.c

index b14a9c46f3b2451f0961f58655b15f71a7f4083e..a4ed2f82a09bcf50fc920971a48127403b6d0b22 100644 (file)
@@ -326,7 +326,7 @@ static int bfin_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
        struct bfin_rtc *rtc = dev_get_drvdata(dev);
        dev_dbg_stamp(dev);
        memcpy(&alrm->time, &rtc->rtc_alarm, sizeof(struct rtc_time));
-       alrm->pending = !!(bfin_read_RTC_ICTL() & (RTC_ISTAT_ALARM | RTC_ISTAT_ALARM_DAY));
+       alrm->enabled = !!(bfin_read_RTC_ICTL() & (RTC_ISTAT_ALARM | RTC_ISTAT_ALARM_DAY));
        return 0;
 }
 
@@ -334,7 +334,7 @@ static int bfin_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
 {
        struct bfin_rtc *rtc = dev_get_drvdata(dev);
        dev_dbg_stamp(dev);
-       memcpy(&rtc->rtc_alarm, &alrm->time, sizeof(struct rtc_time));
+       rtc->rtc_alarm = alrm->time;
        return 0;
 }