aboutsummaryrefslogtreecommitdiffstats
path: root/arch/unicore32
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2011-04-26 13:14:47 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2011-05-11 15:37:15 -0400
commitf98bf4aa39ecce96020631cba910be094c87ac3c (patch)
treea30527c3242e01162e693f1064266a6a1a4a257d /arch/unicore32
parentf25f4f522a9d2e18595da9df0bf1b6f282040e08 (diff)
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: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
Diffstat (limited to 'arch/unicore32')
-rw-r--r--arch/unicore32/kernel/irq.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/arch/unicore32/kernel/irq.c b/arch/unicore32/kernel/irq.c
index 2aa30a364bbe..d4efa7d679ff 100644
--- a/arch/unicore32/kernel/irq.c
+++ b/arch/unicore32/kernel/irq.c
@@ -23,7 +23,7 @@
23#include <linux/list.h> 23#include <linux/list.h>
24#include <linux/kallsyms.h> 24#include <linux/kallsyms.h>
25#include <linux/proc_fs.h> 25#include <linux/proc_fs.h>
26#include <linux/sysdev.h> 26#include <linux/syscore_ops.h>
27#include <linux/gpio.h> 27#include <linux/gpio.h>
28 28
29#include <asm/system.h> 29#include <asm/system.h>
@@ -237,7 +237,7 @@ static struct puv3_irq_state {
237 unsigned int iccr; 237 unsigned int iccr;
238} puv3_irq_state; 238} puv3_irq_state;
239 239
240static int puv3_irq_suspend(struct sys_device *dev, pm_message_t state) 240static int puv3_irq_suspend(void)
241{ 241{
242 struct puv3_irq_state *st = &puv3_irq_state; 242 struct puv3_irq_state *st = &puv3_irq_state;
243 243
@@ -265,7 +265,7 @@ static int puv3_irq_suspend(struct sys_device *dev, pm_message_t state)
265 return 0; 265 return 0;
266} 266}
267 267
268static int puv3_irq_resume(struct sys_device *dev) 268static void puv3_irq_resume(void)
269{ 269{
270 struct puv3_irq_state *st = &puv3_irq_state; 270 struct puv3_irq_state *st = &puv3_irq_state;
271 271
@@ -278,27 +278,20 @@ static int puv3_irq_resume(struct sys_device *dev)
278 278
279 writel(st->icmr, INTC_ICMR); 279 writel(st->icmr, INTC_ICMR);
280 } 280 }
281 return 0;
282} 281}
283 282
284static struct sysdev_class puv3_irq_sysclass = { 283static struct syscore_ops puv3_irq_syscore_ops = {
285 .name = "pkunity-irq",
286 .suspend = puv3_irq_suspend, 284 .suspend = puv3_irq_suspend,
287 .resume = puv3_irq_resume, 285 .resume = puv3_irq_resume,
288}; 286};
289 287
290static struct sys_device puv3_irq_device = { 288static int __init puv3_irq_init_syscore(void)
291 .id = 0,
292 .cls = &puv3_irq_sysclass,
293};
294
295static int __init puv3_irq_init_devicefs(void)
296{ 289{
297 sysdev_class_register(&puv3_irq_sysclass); 290 register_syscore_ops(&puv3_irq_syscore_ops);
298 return sysdev_register(&puv3_irq_device); 291 return 0;
299} 292}
300 293
301device_initcall(puv3_irq_init_devicefs); 294device_initcall(puv3_irq_init_syscore);
302 295
303void __init init_IRQ(void) 296void __init init_IRQ(void)
304{ 297{