Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208454
b: refs/heads/master
c: 70d2a0b
h: refs/heads/master
v: v3
  • Loading branch information
Wan ZongShun authored and Linus Torvalds committed Aug 11, 2010
1 parent c1b2ef2 commit 188dfd7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0a89b55364e0a4fd4be9bc2c9a697f9b027eb395
refs/heads/master: 70d2a0bae26c7c44641785d9def8a0d9048abbea
14 changes: 10 additions & 4 deletions trunk/drivers/rtc/rtc-nuc900.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,18 @@ static void nuc900_rtc_bcd2bin(unsigned int timereg,
rtc_valid_tm(tm);
}

static void nuc900_rtc_bin2bcd(struct rtc_time *settm,
static void nuc900_rtc_bin2bcd(struct device *dev, struct rtc_time *settm,
struct nuc900_bcd_time *gettm)
{
gettm->bcd_mday = bin2bcd(settm->tm_mday) << 0;
gettm->bcd_mon = bin2bcd(settm->tm_mon) << 8;
gettm->bcd_year = bin2bcd(settm->tm_year - 100) << 16;

if (settm->tm_year < 100) {
dev_warn(dev, "The year will be between 1970-1999, right?\n");
gettm->bcd_year = bin2bcd(settm->tm_year) << 16;
} else {
gettm->bcd_year = bin2bcd(settm->tm_year - 100) << 16;
}

gettm->bcd_sec = bin2bcd(settm->tm_sec) << 0;
gettm->bcd_min = bin2bcd(settm->tm_min) << 8;
Expand Down Expand Up @@ -176,7 +182,7 @@ static int nuc900_rtc_set_time(struct device *dev, struct rtc_time *tm)
unsigned long val;
int *err;

nuc900_rtc_bin2bcd(tm, &gettm);
nuc900_rtc_bin2bcd(dev, tm, &gettm);

err = check_rtc_access_enable(rtc);
if (IS_ERR(err))
Expand Down Expand Up @@ -211,7 +217,7 @@ static int nuc900_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
unsigned long val;
int *err;

nuc900_rtc_bin2bcd(&alrm->time, &tm);
nuc900_rtc_bin2bcd(dev, &alrm->time, &tm);

err = check_rtc_access_enable(rtc);
if (IS_ERR(err))
Expand Down

0 comments on commit 188dfd7

Please sign in to comment.