aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2007-05-02 10:25:42 -0400
committerPaul Mackerras <paulus@samba.org>2007-06-25 02:56:09 -0400
commit0c358e70762861f8d479f3fa8bec358c599ba04a (patch)
treeb0948d7a6a39a6db258543eb8826b54068c5664f /arch/powerpc/sysdev
parentee46a90b599952bb1a9dc67f894710017e7cc409 (diff)
[POWERPC] Use mktime in timer sysdev
This makes the timer sysdev use mktime instead of rtc_tm_to_time, since rtc_tm_to_time just calls mktime anyway, and this means we don't have a dependency on rtc-lib. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/sysdev')
-rw-r--r--arch/powerpc/sysdev/timer.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/arch/powerpc/sysdev/timer.c b/arch/powerpc/sysdev/timer.c
index 4a01748b4217..e81e7ec2e799 100644
--- a/arch/powerpc/sysdev/timer.c
+++ b/arch/powerpc/sysdev/timer.c
@@ -24,7 +24,12 @@ static int timer_resume(struct sys_device *dev)
24 24
25 /* get current RTC time and convert to seconds */ 25 /* get current RTC time and convert to seconds */
26 get_rtc_time(&cur_rtc_tm); 26 get_rtc_time(&cur_rtc_tm);
27 rtc_tm_to_time(&cur_rtc_tm, &cur_rtc_time); 27 cur_rtc_time = mktime(cur_rtc_tm.tm_year + 1900,
28 cur_rtc_tm.tm_mon + 1,
29 cur_rtc_tm.tm_mday,
30 cur_rtc_tm.tm_hour,
31 cur_rtc_tm.tm_min,
32 cur_rtc_tm.tm_sec);
28 33
29 diff = cur_rtc_time - suspend_rtc_time; 34 diff = cur_rtc_time - suspend_rtc_time;
30 35
@@ -44,7 +49,12 @@ static int timer_suspend(struct sys_device *dev, pm_message_t state)
44 WARN_ON(!ppc_md.get_rtc_time); 49 WARN_ON(!ppc_md.get_rtc_time);
45 50
46 get_rtc_time(&suspend_rtc_tm); 51 get_rtc_time(&suspend_rtc_tm);
47 rtc_tm_to_time(&suspend_rtc_tm, &suspend_rtc_time); 52 suspend_rtc_time = mktime(suspend_rtc_tm.tm_year + 1900,
53 suspend_rtc_tm.tm_mon + 1,
54 suspend_rtc_tm.tm_mday,
55 suspend_rtc_tm.tm_hour,
56 suspend_rtc_tm.tm_min,
57 suspend_rtc_tm.tm_sec);
48 58
49 return 0; 59 return 0;
50} 60}