aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2011-02-14 05:33:17 -0500
committerJohn Stultz <john.stultz@linaro.org>2011-02-17 17:59:22 -0500
commit516373b8b60fa4152334b6b6f2ece0f178c540ce (patch)
treefdc88e327f0e7143354b1ea4c190bee21aff6c1f /drivers/rtc
parentd8ce1481ee8770ef2314eb7984a2228dbf64ad06 (diff)
RTC: Release mutex in error path of rtc_alarm_irq_enable
On hardware that doesn't support alarm interrupts, rtc_alarm_irq_enable could return without releasing the ops_lock mutex. This was introduced in aa0be0f (RTC: Propagate error handling via rtc_timer_enqueue properly) This patch corrects the issue by only returning once the mutex is released. [john.stultz: Reworded the commit log] Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/interface.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index a0c01967244d..413ae0537915 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -209,9 +209,8 @@ int rtc_alarm_irq_enable(struct rtc_device *rtc, unsigned int enabled)
209 } 209 }
210 210
211 if (err) 211 if (err)
212 return err; 212 /* nothing */;
213 213 else if (!rtc->ops)
214 if (!rtc->ops)
215 err = -ENODEV; 214 err = -ENODEV;
216 else if (!rtc->ops->alarm_irq_enable) 215 else if (!rtc->ops->alarm_irq_enable)
217 err = -EINVAL; 216 err = -EINVAL;