aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc64/kernel/rtc.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2005-10-19 09:11:21 -0400
committerPaul Mackerras <paulus@samba.org>2005-10-19 09:11:21 -0400
commit143a1dec7e04e0a9712ff93e779aabfb21dfd97c (patch)
tree3a60a4e630d792fb3cdc6e962ce0ecfd94bb2672 /arch/ppc64/kernel/rtc.c
parent7ed476d17f04473f70d796cb6c172bdcfcc9b8e5 (diff)
powerpc: Merge machdep.h
A few things change for consistency between ppc32 and ppc64: idle functions return void; *_get_boot_time functions return unsigned long (i.e. time_t) rather than filling in a struct rtc_time (since that's useful to the callers and easier for pmac to generate); *_get_rtc_time and *_set_rtc_time functions take a struct rtc_time; irq_canonicalize is gone; nvram_sync returns void. Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/ppc64/kernel/rtc.c')
-rw-r--r--arch/ppc64/kernel/rtc.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/arch/ppc64/kernel/rtc.c b/arch/ppc64/kernel/rtc.c
index 88ae13f81c46..79e7ed2858dd 100644
--- a/arch/ppc64/kernel/rtc.c
+++ b/arch/ppc64/kernel/rtc.c
@@ -265,7 +265,7 @@ static int rtc_read_proc(char *page, char **start, off_t off,
265#ifdef CONFIG_PPC_RTAS 265#ifdef CONFIG_PPC_RTAS
266#define MAX_RTC_WAIT 5000 /* 5 sec */ 266#define MAX_RTC_WAIT 5000 /* 5 sec */
267#define RTAS_CLOCK_BUSY (-2) 267#define RTAS_CLOCK_BUSY (-2)
268void rtas_get_boot_time(struct rtc_time *rtc_tm) 268unsigned long rtas_get_boot_time(void)
269{ 269{
270 int ret[8]; 270 int ret[8];
271 int error, wait_time; 271 int error, wait_time;
@@ -285,15 +285,10 @@ void rtas_get_boot_time(struct rtc_time *rtc_tm)
285 if (error != 0 && printk_ratelimit()) { 285 if (error != 0 && printk_ratelimit()) {
286 printk(KERN_WARNING "error: reading the clock failed (%d)\n", 286 printk(KERN_WARNING "error: reading the clock failed (%d)\n",
287 error); 287 error);
288 return; 288 return 0;
289 } 289 }
290 290
291 rtc_tm->tm_sec = ret[5]; 291 return mktime(ret[0], ret[1], ret[2], ret[3], ret[4], ret[5]);
292 rtc_tm->tm_min = ret[4];
293 rtc_tm->tm_hour = ret[3];
294 rtc_tm->tm_mday = ret[2];
295 rtc_tm->tm_mon = ret[1] - 1;
296 rtc_tm->tm_year = ret[0] - 1900;
297} 292}
298 293
299/* NOTE: get_rtc_time will get an error if executed in interrupt context 294/* NOTE: get_rtc_time will get an error if executed in interrupt context