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:
@@ -15,7 +15,7 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/sysdev.h>
|
||||
#include <linux/syscore_ops.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
#include <mach/gpio.h>
|
||||
@@ -295,7 +295,7 @@ void __init pxa_init_gpio(int mux_irq, int start, int end, set_wake_t fn)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int pxa_gpio_suspend(struct sys_device *dev, pm_message_t state)
|
||||
static int pxa_gpio_suspend(void)
|
||||
{
|
||||
struct pxa_gpio_chip *c;
|
||||
int gpio;
|
||||
@@ -312,7 +312,7 @@ static int pxa_gpio_suspend(struct sys_device *dev, pm_message_t state)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pxa_gpio_resume(struct sys_device *dev)
|
||||
static void pxa_gpio_resume(void)
|
||||
{
|
||||
struct pxa_gpio_chip *c;
|
||||
int gpio;
|
||||
@@ -326,22 +326,13 @@ static int pxa_gpio_resume(struct sys_device *dev)
|
||||
__raw_writel(c->saved_gfer, c->regbase + GFER_OFFSET);
|
||||
__raw_writel(c->saved_gpdr, c->regbase + GPDR_OFFSET);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
#define pxa_gpio_suspend NULL
|
||||
#define pxa_gpio_resume NULL
|
||||
#endif
|
||||
|
||||
struct sysdev_class pxa_gpio_sysclass = {
|
||||
.name = "gpio",
|
||||
struct syscore_ops pxa_gpio_syscore_ops = {
|
||||
.suspend = pxa_gpio_suspend,
|
||||
.resume = pxa_gpio_resume,
|
||||
};
|
||||
|
||||
static int __init pxa_gpio_init(void)
|
||||
{
|
||||
return sysdev_class_register(&pxa_gpio_sysclass);
|
||||
}
|
||||
|
||||
core_initcall(pxa_gpio_init);
|
||||
|
@@ -17,7 +17,6 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/sysdev.h>
|
||||
|
||||
#include <plat/mfp.h>
|
||||
|
||||
|
Reference in New Issue
Block a user