Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 37662
b: refs/heads/master
c: 1713e90
h: refs/heads/master
v: v3
  • Loading branch information
Jean-Baptiste Maneyrol authored and Linus Torvalds committed Oct 1, 2006
1 parent f52926e commit 29d99d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 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: 365e02237b164701897244aab7412b21c5e622af
refs/heads/master: 1713e903c680de4934837689abecc5df02f463ac
4 changes: 2 additions & 2 deletions trunk/drivers/rtc/rtc-pcf8563.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static int pcf8563_get_datetime(struct i2c_client *client, struct rtc_time *tm)
tm->tm_wday = buf[PCF8563_REG_DW] & 0x07;
tm->tm_mon = BCD2BIN(buf[PCF8563_REG_MO] & 0x1F) - 1; /* rtc mn 1-12 */
tm->tm_year = BCD2BIN(buf[PCF8563_REG_YR])
+ (buf[PCF8563_REG_MO] & PCF8563_MO_C ? 100 : 0);
+ (buf[PCF8563_REG_MO] & PCF8563_MO_C ? 0 : 100);

dev_dbg(&client->dev, "%s: tm is secs=%d, mins=%d, hours=%d, "
"mday=%d, mon=%d, year=%d, wday=%d\n",
Expand Down Expand Up @@ -135,7 +135,7 @@ static int pcf8563_set_datetime(struct i2c_client *client, struct rtc_time *tm)

/* year and century */
buf[PCF8563_REG_YR] = BIN2BCD(tm->tm_year % 100);
if (tm->tm_year / 100)
if (tm->tm_year < 100)
buf[PCF8563_REG_MO] |= PCF8563_MO_C;

buf[PCF8563_REG_DW] = tm->tm_wday & 0x07;
Expand Down

0 comments on commit 29d99d0

Please sign in to comment.