* [merged] rtc-properly-handle-rtc_read_alarm-error-propagation-and-fix-bug.patch removed from -mm tree
@ 2011-01-25 20:18 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2011-01-25 20:18 UTC (permalink / raw)
To: john.stultz, a.zummo, tglx, mm-commits
The patch titled
rtc: properly handle rtc_read_alarm error propagation and fix bug
has been removed from the -mm tree. Its filename was
rtc-properly-handle-rtc_read_alarm-error-propagation-and-fix-bug.patch
This patch was dropped because it was merged into mainline or a subsystem tree
The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/
------------------------------------------------------
Subject: rtc: properly handle rtc_read_alarm error propagation and fix bug
From: John Stultz <john.stultz@linaro.org>
In reviewing cases where the virtualized interfaces didn't propagate
errors properly, I noticed rtc_read_alarm needed fixing. In doing so I
noticed my RTC rework dropped a memset and that the behavior of
rtc_read_alarm shouldn't be conditionalized on the alarm.enabled flag (as
the alarm may be set, but the irqs may be disabled). So those were
corrected as well.
Signed-off-by: John Stultz <john.stultz@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/rtc/interface.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff -puN drivers/rtc/interface.c~rtc-properly-handle-rtc_read_alarm-error-propagation-and-fix-bug drivers/rtc/interface.c
--- a/drivers/rtc/interface.c~rtc-properly-handle-rtc_read_alarm-error-propagation-and-fix-bug
+++ a/drivers/rtc/interface.c
@@ -123,12 +123,18 @@ int rtc_read_alarm(struct rtc_device *rt
err = mutex_lock_interruptible(&rtc->ops_lock);
if (err)
return err;
- alarm->enabled = rtc->aie_timer.enabled;
- if (alarm->enabled)
+ if (rtc->ops == NULL)
+ err = -ENODEV;
+ else if (!rtc->ops->read_alarm)
+ err = -EINVAL;
+ else {
+ memset(alarm, 0, sizeof(struct rtc_wkalrm));
+ alarm->enabled = rtc->aie_timer.enabled;
alarm->time = rtc_ktime_to_tm(rtc->aie_timer.node.expires);
+ }
mutex_unlock(&rtc->ops_lock);
- return 0;
+ return err;
}
EXPORT_SYMBOL_GPL(rtc_read_alarm);
_
Patches currently in -mm which might be from john.stultz@linaro.org are
origin.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-01-25 20:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-25 20:18 [merged] rtc-properly-handle-rtc_read_alarm-error-propagation-and-fix-bug.patch removed from -mm tree akpm
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.