Browse Source

[PATCH] rtc-sh: correctly report rtc_wkalrm.enabled

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>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
David Brownell 18 years ago
parent
commit
0d103e90f6
1 changed files with 2 additions and 2 deletions
  1. 2 2
      drivers/rtc/rtc-sh.c

+ 2 - 2
drivers/rtc/rtc-sh.c

@@ -264,8 +264,6 @@ static int sh_rtc_proc(struct device *dev, struct seq_file *seq)
 	unsigned int tmp;
 	unsigned int tmp;
 
 
 	tmp = readb(rtc->regbase + RCR1);
 	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",
 	seq_printf(seq, "carry_IRQ\t: %s\n",
 		   (tmp & RCR1_CIE) ? "yes" : "no");
 		   (tmp & RCR1_CIE) ? "yes" : "no");
 
 
@@ -428,6 +426,8 @@ static int sh_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *wkalrm)
 		tm->tm_mon -= 1; /* RTC is 1-12, tm_mon is 0-11 */
 		tm->tm_mon -= 1; /* RTC is 1-12, tm_mon is 0-11 */
 	tm->tm_year     = 0xffff;
 	tm->tm_year     = 0xffff;
 
 
+	wkalrm->enabled = (readb(rtc->regbase + RCR1) & RCR1_AIE) ? 1 : 0;
+
 	spin_unlock_irq(&rtc->lock);
 	spin_unlock_irq(&rtc->lock);
 
 
 	return 0;
 	return 0;