Skip to content

Commit

Permalink
Blackfin RTC driver: read_alarm() checks the enabled field, not the p…
Browse files Browse the repository at this point in the history
…ending field.

also, dont bother using memcpy since we can just do an assignment of the same structure.

Signed-off-by: Mike Frysinger <[email protected]>
Signed-off-by: Bryan Wu <[email protected]>
Acked-by: Alessandro Zummo <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Mike Frysinger authored and Linus Torvalds committed Feb 6, 2008
1 parent 5438de4 commit 68db304
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/rtc/rtc-bfin.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,15 +326,15 @@ 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;
}

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;
}

Expand Down

0 comments on commit 68db304

Please sign in to comment.