Commit f98bf4aa authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

PM / UNICORE32: Use struct syscore_ops instead of sysdevs for PM

Make some UNICORE32 architecture's code use struct syscore_ops
objects for power management instead of sysdev classes and sysdevs.

This simplifies the code and reduces the kernel's memory footprint.
It also is necessary for removing sysdevs from the kernel entirely in
the future.
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
Acked-by: default avatarGuan Xuetao <gxt@mprc.pku.edu.cn>
parent f25f4f52
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include <linux/list.h> #include <linux/list.h>
#include <linux/kallsyms.h> #include <linux/kallsyms.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/sysdev.h> #include <linux/syscore_ops.h>
#include <linux/gpio.h> #include <linux/gpio.h>
#include <asm/system.h> #include <asm/system.h>
...@@ -237,7 +237,7 @@ static struct puv3_irq_state { ...@@ -237,7 +237,7 @@ static struct puv3_irq_state {
unsigned int iccr; unsigned int iccr;
} puv3_irq_state; } puv3_irq_state;
static int puv3_irq_suspend(struct sys_device *dev, pm_message_t state) static int puv3_irq_suspend(void)
{ {
struct puv3_irq_state *st = &puv3_irq_state; struct puv3_irq_state *st = &puv3_irq_state;
...@@ -265,7 +265,7 @@ static int puv3_irq_suspend(struct sys_device *dev, pm_message_t state) ...@@ -265,7 +265,7 @@ static int puv3_irq_suspend(struct sys_device *dev, pm_message_t state)
return 0; return 0;
} }
static int puv3_irq_resume(struct sys_device *dev) static void puv3_irq_resume(void)
{ {
struct puv3_irq_state *st = &puv3_irq_state; struct puv3_irq_state *st = &puv3_irq_state;
...@@ -278,27 +278,20 @@ static int puv3_irq_resume(struct sys_device *dev) ...@@ -278,27 +278,20 @@ static int puv3_irq_resume(struct sys_device *dev)
writel(st->icmr, INTC_ICMR); writel(st->icmr, INTC_ICMR);
} }
return 0;
} }
static struct sysdev_class puv3_irq_sysclass = { static struct syscore_ops puv3_irq_syscore_ops = {
.name = "pkunity-irq",
.suspend = puv3_irq_suspend, .suspend = puv3_irq_suspend,
.resume = puv3_irq_resume, .resume = puv3_irq_resume,
}; };
static struct sys_device puv3_irq_device = { static int __init puv3_irq_init_syscore(void)
.id = 0,
.cls = &puv3_irq_sysclass,
};
static int __init puv3_irq_init_devicefs(void)
{ {
sysdev_class_register(&puv3_irq_sysclass); register_syscore_ops(&puv3_irq_syscore_ops);
return sysdev_register(&puv3_irq_device); return 0;
} }
device_initcall(puv3_irq_init_devicefs); device_initcall(puv3_irq_init_syscore);
void __init init_IRQ(void) void __init init_IRQ(void)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment