ARM / Samsung: Use struct syscore_ops for "core" power management

Replace sysdev classes and struct sys_device objects used for "core"
power management by Samsung platforms with struct syscore_ops objects
that are simpler.

This generally reduces the code size and the kernel memory footprint.
It also is necessary for removing sysdevs entirely from the kernel in
the future.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
This commit is contained in:
Rafael J. Wysocki
2011-04-22 22:03:21 +02:00
parent 2eaa03b5be
commit bb072c3cf2
24 changed files with 205 additions and 230 deletions

View File

@@ -16,6 +16,7 @@
#include <linux/init.h>
#include <linux/suspend.h>
#include <linux/syscore_ops.h>
#include <linux/io.h>
#include <plat/cpu.h>
@@ -140,7 +141,17 @@ static int s5pv210_pm_add(struct sys_device *sysdev)
return 0;
}
static int s5pv210_pm_resume(struct sys_device *dev)
static struct sysdev_driver s5pv210_pm_driver = {
.add = s5pv210_pm_add,
};
static __init int s5pv210_pm_drvinit(void)
{
return sysdev_driver_register(&s5pv210_sysclass, &s5pv210_pm_driver);
}
arch_initcall(s5pv210_pm_drvinit);
static void s5pv210_pm_resume(void)
{
u32 tmp;
@@ -150,17 +161,15 @@ static int s5pv210_pm_resume(struct sys_device *dev)
__raw_writel(tmp , S5P_OTHERS);
s3c_pm_do_restore_core(s5pv210_core_save, ARRAY_SIZE(s5pv210_core_save));
return 0;
}
static struct sysdev_driver s5pv210_pm_driver = {
.add = s5pv210_pm_add,
static struct syscore_ops s5pv210_pm_syscore_ops = {
.resume = s5pv210_pm_resume,
};
static __init int s5pv210_pm_drvinit(void)
static __init int s5pv210_pm_syscore_init(void)
{
return sysdev_driver_register(&s5pv210_sysclass, &s5pv210_pm_driver);
register_syscore_ops(&s5pv210_pm_syscore_ops);
return 0;
}
arch_initcall(s5pv210_pm_drvinit);
arch_initcall(s5pv210_pm_syscore_init);