mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Venu Byravarasu <vbyravarasu@nvidia.com>
To: a.zummo@towertech.it, rtc-linux@googlegroups.com,
	linux-kernel@vger.kernel.org
Cc: swarren@nvidia.com, Venu Byravarasu <vbyravarasu@nvidia.com>
Subject: [PATCH 3/3] rtc: twl: Return correct RTC event from ISR
Date: Thu, 19 Jan 2012 15:42:29 +0530	[thread overview]
Message-ID: <1326967949-8248-4-git-send-email-vbyravarasu@nvidia.com> (raw)
In-Reply-To: <1326967949-8248-1-git-send-email-vbyravarasu@nvidia.com>

From: Venu Byravarasu <vbyravarasu@nvidia.com>

Following changes are made as part of this change:
1. As TWL RTC supports periodic interrupt, the correct event
should be RTC_PF instead of RTC_UF.
2. No need to initialize variable "events" to 0 & then OR it
with the event values. Hence fixing it.

Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
---
 drivers/rtc/rtc-twl.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c
index 1c85443..a0236a0 100644
--- a/drivers/rtc/rtc-twl.c
+++ b/drivers/rtc/rtc-twl.c
@@ -357,7 +357,7 @@ out:
 
 static irqreturn_t twl_rtc_interrupt(int irq, void *rtc)
 {
-	unsigned long events = 0;
+	unsigned long events;
 	int ret = IRQ_NONE;
 	int res;
 	u8 rd_reg;
@@ -372,9 +372,9 @@ static irqreturn_t twl_rtc_interrupt(int irq, void *rtc)
 	 * by reading RTS_INTERRUPTS_REGISTER[IT_TIMER,IT_ALARM]
 	 */
 	if (rd_reg & BIT_RTC_STATUS_REG_ALARM_M)
-		events |= RTC_IRQF | RTC_AF;
+		events = RTC_IRQF | RTC_AF;
 	else
-		events |= RTC_IRQF | RTC_UF;
+		events = RTC_IRQF | RTC_PF;
 
 	res = twl_rtc_write_u8(BIT_RTC_STATUS_REG_ALARM_M,
 				   REG_RTC_STATUS_REG);
-- 
1.7.1.1


      parent reply	other threads:[~2012-01-19 10:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-19 10:12 [PATCH 0/3] rtc: twl: update TWL RTC driver Venu Byravarasu
2012-01-19 10:12 ` [PATCH 1/3] rtc: twl: Enable RTC irrespective of its prior state Venu Byravarasu
2012-01-19 10:12 ` [PATCH 2/3] rtc: twl: Simplify RTC interrupt clearing Venu Byravarasu
2012-01-19 10:12 ` Venu Byravarasu [this message]

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=1326967949-8248-4-git-send-email-vbyravarasu@nvidia.com \
    --to=vbyravarasu@nvidia.com \
    --cc=a.zummo@towertech.it \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rtc-linux@googlegroups.com \
    --cc=swarren@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®