All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: Alessandro Zummo <alessandro.zummo@towertech.it>,
	Paul Mundt <lethal@linux-sh.org>,
	lenehan@twibble.org
Cc: Linux Kernel list <linux-kernel@vger.kernel.org>,
	rtc-linux@googlegroups.com
Subject: [patch 2.6.20-rc3] rtc-sh correctly reports rtc_wkalrm.enabled
Date: Fri, 5 Jan 2007 20:55:05 -0800	[thread overview]
Message-ID: <200701052055.06264.david-b@pacbell.net> (raw)

This fixes the SH rtc driver to
  (a) correctly report 'enabled' status with other alarm status;
  (b) not duplicate that status in its procfs dump

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>

---
An audit of the RTC driver treatment of the "enabled" flag turned
up a handful of clear bugs; most drivers handle it the same now
(assuming they support alarms).

This driver has another issue:  sh_rtc_set_alarm() ignores the
"enabled" flag, rather than using it to tell whether the alarm
should be enabled on exit from that routine.  One at a time.  :)

Index: at91/drivers/rtc/rtc-sh.c
===================================================================
--- at91.orig/drivers/rtc/rtc-sh.c	2006-12-18 23:32:22.000000000 -0800
+++ at91/drivers/rtc/rtc-sh.c	2006-12-18 23:34:37.000000000 -0800
@@ -264,8 +264,6 @@ static int sh_rtc_proc(struct device *de
 	unsigned int tmp;
 
 	tmp = readb(rtc->regbase + RCR1);
-	seq_printf(seq, "alarm_IRQ\t: %s\n",
-		   (tmp & RCR1_AIE) ? "yes" : "no");
 	seq_printf(seq, "carry_IRQ\t: %s\n",
 		   (tmp & RCR1_CIE) ? "yes" : "no");
 
@@ -428,6 +426,8 @@ static int sh_rtc_read_alarm(struct devi
 		tm->tm_mon -= 1; /* RTC is 1-12, tm_mon is 0-11 */
 	tm->tm_year     = 0xffff;
 
+	wkalrm->enabled = (readb(rtc->regbase + RCR1) & RCR1_AIE) ? 1 : 0;
+
 	spin_unlock_irq(&rtc->lock);
 
 	return 0;

             reply	other threads:[~2007-01-06  6:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-06  4:55 David Brownell [this message]
2007-01-06 18:49 ` [patch 2.6.20-rc3] rtc-sh correctly reports rtc_wkalrm.enabled Paul Mundt
2007-01-11 11:40 ` Jamie Lenehan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200701052055.06264.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=alessandro.zummo@towertech.it \
    --cc=lenehan@twibble.org \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rtc-linux@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.