aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-26 00:07:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-26 00:07:59 -0400
commit16c29dafcc86024048f1dbb8349d31cb22c7c55a (patch)
tree100c4fd34903adf02c9b8ae7705a3e1f30c8d712 /kernel
parentdc50eddb2f3a0dff365f093b2a93fb4ab4dd4389 (diff)
parentd47d81c0e9abdc3c88653fabff5beae82c949b09 (diff)
Merge branch 'syscore' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6
* 'syscore' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6: Introduce ARCH_NO_SYSDEV_OPS config option (v2) cpufreq: Use syscore_ops for boot CPU suspend/resume (v2) KVM: Use syscore_ops instead of sysdev class and sysdev PCI / Intel IOMMU: Use syscore_ops instead of sysdev class and sysdev timekeeping: Use syscore_ops instead of sysdev class and sysdev x86: Use syscore_ops instead of sysdev classes and sysdevs
Diffstat (limited to 'kernel')
-rw-r--r--kernel/time/timekeeping.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 3bd7e3d5c632..8ad5d576755e 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -14,7 +14,7 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/mm.h> 15#include <linux/mm.h>
16#include <linux/sched.h> 16#include <linux/sched.h>
17#include <linux/sysdev.h> 17#include <linux/syscore_ops.h>
18#include <linux/clocksource.h> 18#include <linux/clocksource.h>
19#include <linux/jiffies.h> 19#include <linux/jiffies.h>
20#include <linux/time.h> 20#include <linux/time.h>
@@ -597,13 +597,12 @@ static struct timespec timekeeping_suspend_time;
597 597
598/** 598/**
599 * timekeeping_resume - Resumes the generic timekeeping subsystem. 599 * timekeeping_resume - Resumes the generic timekeeping subsystem.
600 * @dev: unused
601 * 600 *
602 * This is for the generic clocksource timekeeping. 601 * This is for the generic clocksource timekeeping.
603 * xtime/wall_to_monotonic/jiffies/etc are 602 * xtime/wall_to_monotonic/jiffies/etc are
604 * still managed by arch specific suspend/resume code. 603 * still managed by arch specific suspend/resume code.
605 */ 604 */
606static int timekeeping_resume(struct sys_device *dev) 605static void timekeeping_resume(void)
607{ 606{
608 unsigned long flags; 607 unsigned long flags;
609 struct timespec ts; 608 struct timespec ts;
@@ -632,11 +631,9 @@ static int timekeeping_resume(struct sys_device *dev)
632 631
633 /* Resume hrtimers */ 632 /* Resume hrtimers */
634 hres_timers_resume(); 633 hres_timers_resume();
635
636 return 0;
637} 634}
638 635
639static int timekeeping_suspend(struct sys_device *dev, pm_message_t state) 636static int timekeeping_suspend(void)
640{ 637{
641 unsigned long flags; 638 unsigned long flags;
642 639
@@ -654,26 +651,18 @@ static int timekeeping_suspend(struct sys_device *dev, pm_message_t state)
654} 651}
655 652
656/* sysfs resume/suspend bits for timekeeping */ 653/* sysfs resume/suspend bits for timekeeping */
657static struct sysdev_class timekeeping_sysclass = { 654static struct syscore_ops timekeeping_syscore_ops = {
658 .name = "timekeeping",
659 .resume = timekeeping_resume, 655 .resume = timekeeping_resume,
660 .suspend = timekeeping_suspend, 656 .suspend = timekeeping_suspend,
661}; 657};
662 658
663static struct sys_device device_timer = { 659static int __init timekeeping_init_ops(void)
664 .id = 0,
665 .cls = &timekeeping_sysclass,
666};
667
668static int __init timekeeping_init_device(void)
669{ 660{
670 int error = sysdev_class_register(&timekeeping_sysclass); 661 register_syscore_ops(&timekeeping_syscore_ops);
671 if (!error) 662 return 0;
672 error = sysdev_register(&device_timer);
673 return error;
674} 663}
675 664
676device_initcall(timekeeping_init_device); 665device_initcall(timekeeping_init_ops);
677 666
678/* 667/*
679 * If the error is already larger, we look ahead even further 668 * If the error is already larger, we look ahead even further