Atsushi Nemoto wrote:
> >>>>> On Sat, 10 Nov 2001 23:17:46 -0800, Jun Sun <email@example.com> said:
> jsun> For many MIPS boards that start to use CONFIG_NEW_TIME_C, two
> jsun> rtc operations are implemented, rtc_get_time() and
> jsun> rtc_set_time().
> jsun> It is possible to write a simple generic RTC driver that is
> jsun> based on these two ops and can do simple RTC read&write ops.
> jsun> This is the idea behind the generic MIPS rtc driver. See the
> jsun> patch below.
> jsun> Any comments?
> Good idea. I hope cvs kernel import this patch.
> I found two small things to fix. to_tm function sets 1..12 value in
> tm_mon field, so
> 1. in rtc_ioctl (case RTC_RD_TIME), subtracting 1 from rtc_tm.tm_mon
> is needed.
> 2. in rtc_proc_output, adding 1 to tm.tm_mon is not needed.
Good eye for spotting this. :-)
It turned out that tm_mon in rtc_time struct really should start from 0 to 11
(by definition). So there is a bug in to_tm(). I sent a patch to Ralf and I
think he applied already.