lkml.org 
[lkml]   [2019]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 05/12] rtc: pcf85063: set range
    Date
    This is a standard BCD RTC that will fail in 2100.

    Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
    ---
    drivers/rtc/rtc-pcf85063.c | 5 ++---
    1 file changed, 2 insertions(+), 3 deletions(-)

    diff --git a/drivers/rtc/rtc-pcf85063.c b/drivers/rtc/rtc-pcf85063.c
    index afd98e863482..5e993162c5b2 100644
    --- a/drivers/rtc/rtc-pcf85063.c
    +++ b/drivers/rtc/rtc-pcf85063.c
    @@ -113,9 +113,6 @@ static int pcf85063_rtc_set_time(struct device *dev, struct rtc_time *tm)
    u8 regs[7];
    u8 ctrl1;

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

    rtc->ops = &pcf85063_rtc_ops;
    + rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
    + rtc->range_max = RTC_TIMESTAMP_END_2099;

    return rtc_register_device(rtc);
    }
    --
    2.20.1
    \
     
     \ /
      Last update: 2019-04-01 18:09    [W:4.325 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site