Commit 68db3047 authored by Mike Frysinger's avatar Mike Frysinger Committed by Linus Torvalds

Blackfin RTC driver: read_alarm() checks the enabled field, not the pending field.

also, dont bother using memcpy since we can just do an assignment of the same structure.
Signed-off-by: default avatarMike Frysinger <michael.frysinger@analog.com>
Signed-off-by: default avatarBryan Wu <bryan.wu@analog.com>
Acked-by: default avatarAlessandro Zummo <alessandro.zummo@towertech.it>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 5438de44
...@@ -326,7 +326,7 @@ static int bfin_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) ...@@ -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); struct bfin_rtc *rtc = dev_get_drvdata(dev);
dev_dbg_stamp(dev); dev_dbg_stamp(dev);
memcpy(&alrm->time, &rtc->rtc_alarm, sizeof(struct rtc_time)); 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; return 0;
} }
...@@ -334,7 +334,7 @@ static int bfin_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) ...@@ -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); struct bfin_rtc *rtc = dev_get_drvdata(dev);
dev_dbg_stamp(dev); dev_dbg_stamp(dev);
memcpy(&rtc->rtc_alarm, &alrm->time, sizeof(struct rtc_time)); rtc->rtc_alarm = alrm->time;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment