Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 120015
b: refs/heads/master
c: cc6c2ca
h: refs/heads/master
i:
  120013: 5363866
  120011: 8fdb5c0
  120007: df08abb
  119999: 161b27b
v: v3
  • Loading branch information
Chris Elston authored and Linus Torvalds committed Dec 23, 2008
1 parent 6fb1b24 commit 9701ecd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c47a75a45fa3a9d98b61f7e31983ffab2c44404f
refs/heads/master: cc6c2ca30074a0274c05dd3212c741a550f0d3c2
7 changes: 7 additions & 0 deletions trunk/drivers/rtc/rtc-isl1208.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,13 @@ isl1208_i2c_set_time(struct i2c_client *client, struct rtc_time const *tm)
int sr;
u8 regs[ISL1208_RTC_SECTION_LEN] = { 0, };

/* The clock has an 8 bit wide bcd-coded register (they never learn)
* for the year. tm_year is an offset from 1900 and we are interested
* in the 2000-2099 range, so any value less than 100 is invalid.
*/
if (tm->tm_year < 100)
return -EINVAL;

regs[ISL1208_REG_SC] = bin2bcd(tm->tm_sec);
regs[ISL1208_REG_MN] = bin2bcd(tm->tm_min);
regs[ISL1208_REG_HR] = bin2bcd(tm->tm_hour) | ISL1208_REG_HR_MIL;
Expand Down

0 comments on commit 9701ecd

Please sign in to comment.