LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 1/2] rtc: Fix handling of missing tm_year data when reading alarms
@ 2008-10-27 15:38 Mark Brown
  2008-10-27 15:38 ` [PATCH 2/2] rtc: rtc-wm8350: Add support for WM8350 RTC Mark Brown
  2008-10-27 16:51 ` [PATCH 1/2] rtc: Fix handling of missing tm_year data when reading alarms Alessandro Zummo
  0 siblings, 2 replies; 14+ messages in thread
From: Mark Brown @ 2008-10-27 15:38 UTC (permalink / raw)
  To: Alessandro Zummo, David Brownell
  Cc: Andrew Morton, linux-kernel, rtc-linux, Mark Brown

When fixing up invalid years rtc_read_alarm() is callign rtc_valid_tm()
as a boolean but rtc_valid_tm() returns zero on success or a negative
number if the time is not valid so the test is inverted.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/rtc/interface.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index 7af60b9..a04c1b6 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -271,7 +271,7 @@ int rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
 		dev_dbg(&rtc->dev, "alarm rollover: %s\n", "year");
 		do {
 			alarm->time.tm_year++;
-		} while (!rtc_valid_tm(&alarm->time));
+		} while (rtc_valid_tm(&alarm->time) != 0);
 		break;
 
 	default:
-- 
1.5.6.5


^ permalink raw reply	[flat|nested] 14+ messages in thread
* [PATCH 0/2] RTC updates
@ 2008-10-20 19:33 Mark Brown
  2008-10-20 19:35 ` [PATCH 1/2] rtc: Fix handling of missing tm_year data when reading alarms Mark Brown
  0 siblings, 1 reply; 14+ messages in thread
From: Mark Brown @ 2008-10-20 19:33 UTC (permalink / raw)
  To: Alessandro Zummo; +Cc: linux-kernel, rtc-linux

This patch series fixes a bug in the RTC core and adds support for the
WM8350 RTC.  The bug fix is required for the WM8350 driver since it does
not support configuration of the year for alarms, triggering the need to
handle year wraparound when reporting the alarm status.

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

end of thread, other threads:[~2008-10-28 10:02 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-27 15:38 [PATCH 1/2] rtc: Fix handling of missing tm_year data when reading alarms Mark Brown
2008-10-27 15:38 ` [PATCH 2/2] rtc: rtc-wm8350: Add support for WM8350 RTC Mark Brown
2008-10-27 17:04   ` [rtc-linux] " Alessandro Zummo
2008-10-27 17:24     ` [rtc-linux] " Mark Brown
2008-10-27 17:26       ` Alessandro Zummo
2008-10-27 17:40         ` Mark Brown
2008-10-28  6:24           ` Andrew Morton
2008-10-27 20:03     ` [rtc-linux] " David Brownell
2008-10-27 20:09       ` Mark Brown
2008-10-27 20:19         ` David Brownell
2008-10-28  6:22   ` Andrew Morton
2008-10-28 10:02     ` Mark Brown
2008-10-27 16:51 ` [PATCH 1/2] rtc: Fix handling of missing tm_year data when reading alarms Alessandro Zummo
  -- strict thread matches above, loose matches on Subject: below --
2008-10-20 19:33 [PATCH 0/2] RTC updates Mark Brown
2008-10-20 19:35 ` [PATCH 1/2] rtc: Fix handling of missing tm_year data when reading alarms Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).