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

Replace sysdev classes and struct sys_device objects used for "core"
power management by the PXA platform code with struct syscore_ops
objects that are simpler.

This 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>
This commit is contained in:
Rafael J. Wysocki
2011-04-22 22:03:11 +02:00
parent 905339807b
commit 2eaa03b5be
31 changed files with 110 additions and 307 deletions

View File

@@ -15,7 +15,7 @@
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/sysdev.h>
#include <linux/syscore_ops.h>
#include <linux/interrupt.h>
#include <linux/sched.h>
#include <linux/bitops.h>
@@ -159,30 +159,22 @@ static void __init lpd270_init_irq(void)
#ifdef CONFIG_PM
static int lpd270_irq_resume(struct sys_device *dev)
static void lpd270_irq_resume(void)
{
__raw_writew(lpd270_irq_enabled, LPD270_INT_MASK);
return 0;
}
static struct sysdev_class lpd270_irq_sysclass = {
.name = "cpld_irq",
static struct syscore_ops lpd270_irq_syscore_ops = {
.resume = lpd270_irq_resume,
};
static struct sys_device lpd270_irq_device = {
.cls = &lpd270_irq_sysclass,
};
static int __init lpd270_irq_device_init(void)
{
int ret = -ENODEV;
if (machine_is_logicpd_pxa270()) {
ret = sysdev_class_register(&lpd270_irq_sysclass);
if (ret == 0)
ret = sysdev_register(&lpd270_irq_device);
register_syscore_ops(&lpd270_irq_syscore_ops);
return 0;
}
return ret;
return -ENODEV;
}
device_initcall(lpd270_irq_device_init);