All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rtc-m48t59: fix setting of a year on m48t08 and m48t02 rtcs
@ 2008-09-04 16:57 Krzysztof Helt
  2008-09-08  1:26 ` [PATCH] rtc-m48t59: fix setting of a year on m48t08 and m48t02 David Miller
                   ` (19 more replies)
  0 siblings, 20 replies; 21+ messages in thread
From: Krzysztof Helt @ 2008-09-04 16:57 UTC (permalink / raw)
  To: sparclinux

From: Krzysztof Helt <krzysztof.h1@wp.pl>

Fix setting of a year in m48t08 and m48t02 clocks.
They do not have century bits and setting them
causes the year to overflow (bit 0x80 set).

Problem found by Robert Reif on Sun Sparcstation 20.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>

---

I am sorry. I was sure I had tested setting of time
and date on SS20 but I did not obviously.

diff -urp linux-old/drivers/rtc/rtc-m48t59.c linux-sparc/drivers/rtc/rtc-m48t59.c
--- linux-old/drivers/rtc/rtc-m48t59.c	2008-09-03 18:14:22.000000000 +0200
+++ linux-sparc/drivers/rtc/rtc-m48t59.c	2008-09-04 18:47:40.636685547 +0200
@@ -126,7 +126,7 @@ static int m48t59_rtc_set_time(struct de
 	M48T59_WRITE((BIN2BCD(tm->tm_mon + 1) & 0x1F), M48T59_MONTH);
 	M48T59_WRITE(BIN2BCD(tm->tm_year % 100), M48T59_YEAR);
 
-	if (tm->tm_year/100)
+	if (pdata->type = M48T59RTC_TYPE_M48T59 && (tm->tm_year / 100))
 		val = (M48T59_WDAY_CEB | M48T59_WDAY_CB);
 	val |= (BIN2BCD(tm->tm_wday) & 0x07);
 	M48T59_WRITE(val, M48T59_WDAY);


----------------------------------------------------------------------
Nie szukam kochanka!
>> http://link.interia.pl/f1eeb


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2008-10-23 17:32 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-04 16:57 [PATCH] rtc-m48t59: fix setting of a year on m48t08 and m48t02 rtcs Krzysztof Helt
2008-09-08  1:26 ` [PATCH] rtc-m48t59: fix setting of a year on m48t08 and m48t02 David Miller
2008-09-10  2:07 ` Robert Reif
2008-09-10  2:30 ` David Miller
2008-09-10  2:30 ` David Miller
2008-09-10  2:38 ` David Miller
2008-09-10  5:16 ` Krzysztof Helt
2008-09-10 10:53 ` Robert Reif
2008-09-11 10:04 ` [PATCH] rtc-m48t59: fix setting of a year on m48t08 and m48t02 rtcs Alexander Beregalov
2008-09-13 10:33 ` [PATCH] rtc-m48t59: fix setting of a year on m48t08 and m48t02 Krzysztof Helt
2008-10-03 20:38 ` [PATCH] rtc-m48t59: fix setting of a year on m48t08 and m48t02 rtcs Alexander Beregalov
2008-10-04 10:27 ` krzysztof.h1
2008-10-04 11:26 ` Alexander Beregalov
2008-10-07 21:39 ` [PATCH] rtc-m48t59: fix setting of a year on m48t08 and m48t02 Krzysztof Helt
2008-10-07 21:40 ` David Miller
2008-10-13 20:51 ` Krzysztof Helt
2008-10-13 22:12 ` [PATCH] rtc-m48t59: fix setting of a year on m48t08 and m48t02 rtcs Alexander Beregalov
2008-10-19 14:12 ` [PATCH] rtc-m48t59: fix setting of a year on m48t08 and m48t02 Krzysztof Helt
2008-10-19 22:17 ` [PATCH] rtc-m48t59: fix setting of a year on m48t08 and m48t02 rtcs Alexander Beregalov
2008-10-19 23:31 ` Alexander Beregalov
2008-10-23 17:32 ` [PATCH] rtc-m48t59: fix setting of a year on m48t08 and m48t02 Krzysztof Helt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.