aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc64/kernel/rtc.c
diff options
context:
space:
mode:
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