[PATCH 14/14] arm: Convert arm to use read_persistent_clock

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: John Stultz
Date: Wednesday, March 3, 2010 - 8:57 pm

This patch converts the arm architecture to use the generic read_persistent_clock and update_persistent_clock interfaces, reducing the amount of arch specific code we have to maintain, and allowing for further cleanups in the future.

Also removes a direct xtime access, replacing it with current_kernel_time()

I have not built or tested this patch, so help from arch maintainers would be appreciated.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Russell King <linux@arm.linux.org.uk>
Signed-off-by: John Stultz <johnstul@us.ibm.com>
---
 arch/arm/Kconfig       |    3 +++
 arch/arm/kernel/time.c |    7 +++++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 3b18128..b70929d 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -43,6 +43,9 @@ config GENERIC_GPIO
 config GENERIC_TIME
 	bool
 
+config GENERIC_CMOS_UPDATE
+        def_bool y
+
 config GENERIC_CLOCKEVENTS
 	bool
 
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index 2875380..eebe8f5 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -79,6 +79,13 @@ static unsigned long dummy_gettimeoffset(void)
 }
 #endif
 
+int update_persistent_clock(struct timespec now)
+{
+	if (set_rtc == NULL)
+		return -1;
+	return set_rtc(now);
+}
+
 #ifdef CONFIG_LEDS_TIMER
 static inline void do_leds(void)
 {
-- 
1.6.0.4

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 14/14] arm: Convert arm to use read_persistent_clock, John Stultz, (Wed Mar 3, 8:57 pm)
Re: [PATCH 14/14] arm: Convert arm to use read_persistent_ ..., Russell King - ARM Linux, (Thu Mar 4, 2:36 am)
[tip:timers/cleanup] alpha: Convert alpha to use read/upda ..., tip-bot for John Stultz, (Fri Mar 12, 5:19 pm)
[tip:timers/cleanup] mn10300: Convert mn10300 to use read/ ..., tip-bot for John Stultz, (Fri Mar 12, 5:19 pm)
[tip:timers/cleanup] frv: Convert frv to use read/update_p ..., tip-bot for John Stultz, (Fri Mar 12, 5:19 pm)
[tip:timers/cleanup] h8300: Convert h8300 to use read/upda ..., tip-bot for John Stultz, (Fri Mar 12, 5:20 pm)
[tip:timers/cleanup] avr32: Convert avr32 to use read/upda ..., tip-bot for John Stultz, (Fri Mar 12, 5:20 pm)
[tip:timers/cleanup] ia64: Convert ia64 to use read/update ..., tip-bot for John Stultz, (Fri Mar 12, 5:20 pm)
[tip:timers/cleanup] blackfin: Convert blackfin to use rea ..., tip-bot for John Stultz, (Fri Mar 12, 5:20 pm)
[tip:timers/cleanup] m32r: Convert m32r to use read/update ..., tip-bot for John Stultz, (Fri Mar 12, 5:21 pm)
[tip:timers/cleanup] m68k: Convert m68k to use read/update ..., tip-bot for John Stultz, (Fri Mar 12, 5:21 pm)
[tip:timers/cleanup] cris: Convert cris to use read/update ..., tip-bot for John Stultz, (Fri Mar 12, 5:21 pm)