Re: [PATCH] rtc: add support for maxim dallas rtc ds1347

From: Joe Perches
Date: Thu Mar 20 2014 - 15:20:16 EST


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)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/