Messages in this thread | | | Subject | Re: [PATCH] rtc: add support for maxim dallas rtc ds1347 | From | Joe Perches <> | Date | Thu, 20 Mar 2014 12:19:55 -0700 |
| |
On Fri, 2014-03-21 at 00:30 +0530, RAGHAVENDRA GANIGA wrote: > This is a patch to add support for > maxim dallas rtc ds1347 [] > diff --git a/drivers/rtc/rtc-ds1347.c b/drivers/rtc/rtc-ds1347.c [] > +static int ds1347_read_time(struct device *dev, struct rtc_time *dt) > +{ [] > + /* year in linux is from 1900 i.e in range of 100 > + in rtc it is from 00 to 99 so subtract > + the linux year by 100 */
> + if (dt->tm_year >= 100) > + dt->tm_year -= 100;
This depends on how long you want to live, but it could be
while (dt->tm_year >= 100)
| |