Skip to content

Commit 802a779

Browse files
rtc: pcf85063: set range
This is a standard BCD RTC that will fail in 2100. Signed-off-by: Alexandre Belloni <[email protected]>
1 parent 3555a34 commit 802a779

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/rtc/rtc-pcf85063.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,6 @@ static int pcf85063_rtc_set_time(struct device *dev, struct rtc_time *tm)
113113
u8 regs[7];
114114
u8 ctrl1;
115115

116-
if ((tm->tm_year < 100) || (tm->tm_year > 199))
117-
return -EINVAL;
118-
119116
/*
120117
* to accurately set the time, reset the divider chain and keep it in
121118
* reset state until all time/date registers are written
@@ -223,6 +220,8 @@ static int pcf85063_probe(struct i2c_client *client)
223220
return PTR_ERR(rtc);
224221

225222
rtc->ops = &pcf85063_rtc_ops;
223+
rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
224+
rtc->range_max = RTC_TIMESTAMP_END_2099;
226225

227226
return rtc_register_device(rtc);
228227
}

0 commit comments

Comments
 (0)