[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1351700583.15558.1573.camel@cliu38-desktop-build>
Date: Thu, 01 Nov 2012 00:23:03 +0800
From: Chuansheng Liu <chuansheng.liu@...el.com>
To: john.stultz@...aro.org, tglx@...utronix.de,
gregkh@...uxfoundation.org
Cc: linux-kernel@...r.kernel.org, chuansheng.liu@...el.com
Subject: [PATCH 2/3] alarmtimer: Using the alarmtimer_get_rtcdev for all
posix clock interface
Some posix clock interface directly use the variable rtcdev,
cleanup it here by alarmtimer_get_rtcdev().
Signed-off-by: liu chuansheng <chuansheng.liu@...el.com>
---
kernel/time/alarmtimer.c | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
index 4fc17cb..5490fa8 100644
--- a/kernel/time/alarmtimer.c
+++ b/kernel/time/alarmtimer.c
@@ -86,11 +86,10 @@ static int alarmtimer_rtc_add_device(struct device *dev,
return -1;
mutex_lock(&rtcdev_mutex);
- if (!rtcdev) {
- rtcdev = rtc;
- /* hold a reference so it doesn't go away */
- get_device(dev);
- }
+ rtcdev = rtc;
+ /* hold a reference so it doesn't go away */
+ get_device(dev);
+
mutex_unlock(&rtcdev_mutex);
return 0;
}
@@ -516,7 +515,7 @@ static void alarm_timer_get(struct k_itimer *timr,
*/
static int alarm_timer_del(struct k_itimer *timr)
{
- if (!rtcdev)
+ if (!alarmtimer_get_rtcdev())
return -ENOTSUPP;
if (alarm_try_to_cancel(&timr->it.alarm.alarmtimer) < 0)
@@ -538,7 +537,7 @@ static int alarm_timer_set(struct k_itimer *timr, int flags,
struct itimerspec *new_setting,
struct itimerspec *old_setting)
{
- if (!rtcdev)
+ if (!alarmtimer_get_rtcdev())
return -ENOTSUPP;
if (old_setting)
--
1.7.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists