Commit d90246cd authored by Martin Schwidefsky's avatar Martin Schwidefsky Committed by Ingo Molnar

timekeeping: Increase granularity of read_persistent_clock(), build fix

Fix the following build problem on powerpc:

  arch/powerpc/kernel/time.c: In function 'read_persistent_clock':
  arch/powerpc/kernel/time.c:788: error: 'return' with a value, in function returning void
  arch/powerpc/kernel/time.c:791: error: 'return' with a value, in function returning void
Reported-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Cc: dwalker@fifo99.com
Cc: johnstul@us.ibm.com
LKML-Reference: <20090822222313.74b9619c@skybase>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent da15cfda
...@@ -774,6 +774,7 @@ void read_persistent_clock(struct timespec *ts) ...@@ -774,6 +774,7 @@ void read_persistent_clock(struct timespec *ts)
struct rtc_time tm; struct rtc_time tm;
static int first = 1; static int first = 1;
ts->tv_nsec = 0;
/* XXX this is a litle fragile but will work okay in the short term */ /* XXX this is a litle fragile but will work okay in the short term */
if (first) { if (first) {
first = 0; first = 0;
...@@ -781,15 +782,18 @@ void read_persistent_clock(struct timespec *ts) ...@@ -781,15 +782,18 @@ void read_persistent_clock(struct timespec *ts)
timezone_offset = ppc_md.time_init(); timezone_offset = ppc_md.time_init();
/* get_boot_time() isn't guaranteed to be safe to call late */ /* get_boot_time() isn't guaranteed to be safe to call late */
if (ppc_md.get_boot_time) if (ppc_md.get_boot_time) {
return ppc_md.get_boot_time() -timezone_offset; ts->tv_sec = ppc_md.get_boot_time() - timezone_offset;
return;
}
}
if (!ppc_md.get_rtc_time) {
ts->tv_sec = 0;
return;
} }
if (!ppc_md.get_rtc_time)
return 0;
ppc_md.get_rtc_time(&tm); ppc_md.get_rtc_time(&tm);
ts->tv_sec = mktime(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday, ts->tv_sec = mktime(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
tm.tm_hour, tm.tm_min, tm.tm_sec); tm.tm_hour, tm.tm_min, tm.tm_sec);
ts->tv_nsec = 0;
} }
/* clocksource code */ /* clocksource code */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment