From: rjw@sisk.pl (Rafael J. Wysocki)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/7] ARM / Integrator: Use struct syscore_ops for "core" power management
Date: Mon, 28 Mar 2011 01:27:47 +0200 [thread overview]
Message-ID: <201103280127.47342.rjw@sisk.pl> (raw)
In-Reply-To: <201103280125.11750.rjw@sisk.pl>
From: Rafael J. Wysocki <rjw@sisk.pl>
Replace the sysdev class and struct sys_device used for power
management by the Integrator interrupt-handling code with a
struct syscore_ops object which is simpler.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
arch/arm/mach-integrator/integrator_ap.c | 26 +++++++++-----------------
1 file changed, 9 insertions(+), 17 deletions(-)
Index: linux-2.6/arch/arm/mach-integrator/integrator_ap.c
===================================================================
--- linux-2.6.orig/arch/arm/mach-integrator/integrator_ap.c
+++ linux-2.6/arch/arm/mach-integrator/integrator_ap.c
@@ -24,7 +24,7 @@
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/string.h>
-#include <linux/sysdev.h>
+#include <linux/syscore_ops.h>
#include <linux/amba/bus.h>
#include <linux/amba/kmi.h>
#include <linux/clocksource.h>
@@ -180,13 +180,13 @@ static void __init ap_init_irq(void)
#ifdef CONFIG_PM
static unsigned long ic_irq_enable;
-static int irq_suspend(struct sys_device *dev, pm_message_t state)
+static int irq_suspend(void)
{
ic_irq_enable = readl(VA_IC_BASE + IRQ_ENABLE);
return 0;
}
-static int irq_resume(struct sys_device *dev)
+static void irq_resume(void)
{
/* disable all irq sources */
writel(-1, VA_CMIC_BASE + IRQ_ENABLE_CLEAR);
@@ -194,33 +194,25 @@ static int irq_resume(struct sys_device
writel(-1, VA_IC_BASE + FIQ_ENABLE_CLEAR);
writel(ic_irq_enable, VA_IC_BASE + IRQ_ENABLE_SET);
- return 0;
}
#else
#define irq_suspend NULL
#define irq_resume NULL
#endif
-static struct sysdev_class irq_class = {
- .name = "irq",
+static struct syscore_ops irq_syscore_ops = {
.suspend = irq_suspend,
.resume = irq_resume,
};
-static struct sys_device irq_device = {
- .id = 0,
- .cls = &irq_class,
-};
-
-static int __init irq_init_sysfs(void)
+static int __init irq_syscore_init(void)
{
- int ret = sysdev_class_register(&irq_class);
- if (ret == 0)
- ret = sysdev_register(&irq_device);
- return ret;
+ register_syscore_ops(&irq_syscore_ops);
+
+ return 0;
}
-device_initcall(irq_init_sysfs);
+device_initcall(irq_syscore_init);
/*
* Flash handling.
next prev parent reply other threads:[~2011-03-27 23:27 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-27 23:25 [PATCH 0/7] ARM: Use syscore_ops for "core" power management Rafael J. Wysocki
2011-03-27 23:26 ` [PATCH 1/7] ARM: Use struct syscore_ops instead of sysdevs for PM in common code Rafael J. Wysocki
2011-03-27 23:27 ` [PATCH 2/7] ARM / OMAP: Use struct syscore_ops for "core" power management Rafael J. Wysocki
2011-03-28 16:18 ` Kevin Hilman
2011-03-27 23:27 ` Rafael J. Wysocki [this message]
2011-03-27 23:28 ` [PATCH 4/7] ARM / SA1100: " Rafael J. Wysocki
2011-03-27 23:29 ` [PATCH 5/7] ARM / PXA: " Rafael J. Wysocki
2011-03-27 23:29 ` [PATCH 6/7] ARM / Samsung: " Rafael J. Wysocki
2011-03-27 23:45 ` Ben Dooks
2011-03-28 19:42 ` Rafael J. Wysocki
2011-07-08 18:12 ` Rafael J. Wysocki
2011-03-27 23:30 ` [PATCH 7/7] ARM: Select CONFIG_ARCH_NO_SYSDEV_OPS Rafael J. Wysocki
2011-04-17 21:01 ` [PATCH 0/14] Remove sysdev suspend/resume and shutdown operations Rafael J. Wysocki
2011-04-17 21:05 ` [PATCH 1/14] PM: Fix error code paths executed after failing syscore_suspend() Rafael J. Wysocki
2011-04-17 21:06 ` [PATCH 2/14] PM: Add missing syscore_suspend() and syscore_resume() calls Rafael J. Wysocki
2011-04-18 8:51 ` Ian Campbell
2011-04-17 21:07 ` [PATCH 3/14] ARM: Use struct syscore_ops instead of sysdevs for PM in common code Rafael J. Wysocki
2011-04-17 21:08 ` [PATCH 4/14] ARM / OMAP: Use struct syscore_ops for "core" power management Rafael J. Wysocki
2011-04-17 21:09 ` [PATCH 5/14] ARM / Integrator: Use struct syscore_ops for core PM Rafael J. Wysocki
2011-04-17 21:10 ` [PATCH 6/14] ARM / SA1100: Use struct syscore_ops for "core" power management Rafael J. Wysocki
2011-04-17 21:10 ` [PATCH 7/14] ARM / PXA: " Rafael J. Wysocki
2011-04-17 21:11 ` [PATCH 8/14] ARM / Samsung: " Rafael J. Wysocki
2011-04-17 21:49 ` Kukjin Kim
2011-04-17 21:11 ` [PATCH 9/14] PM / Blackfin: Use struct syscore_ops instead of sysdevs for PM Rafael J. Wysocki
2011-04-18 2:34 ` Mike Frysinger
2011-04-18 21:43 ` Rafael J. Wysocki
2011-04-17 21:12 ` [PATCH 10/14] PM / MIPS: " Rafael J. Wysocki
2011-04-18 10:12 ` Ralf Baechle
2011-04-18 20:03 ` Rafael J. Wysocki
2011-04-19 3:08 ` Lars-Peter Clausen
2011-04-17 21:13 ` [PATCH 11/14] PM / AVR32: " Rafael J. Wysocki
2011-04-26 12:22 ` Hans-Christian Egtvedt
2011-04-26 17:14 ` Rafael J. Wysocki
2011-04-17 21:13 ` [PATCH 12/14] PM / UNICORE32: " Rafael J. Wysocki
2011-04-19 8:02 ` Guan Xuetao
2011-04-17 21:14 ` [PATCH 13/14] PM / PowerPC: " Rafael J. Wysocki
2011-04-17 21:15 ` [PATCH 14/14] PM: Remove sysdev suspend, resume and shutdown operations Rafael J. Wysocki
2011-04-18 6:02 ` [PATCH 0/14] Remove sysdev suspend/resume " Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201103280127.47342.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).