linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Kevin Hilman <khilman@ti.com>, Guan Xuetao <gxt@mprc.pku.edu.cn>,
	Russell King <linux@arm.linux.org.uk>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Greg KH <gregkh@suse.de>, Ralf Baechle <ralf@linux-mips.org>,
	Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>,
	Ben Dooks <ben-linux@fluff.org>, Jiri Kosina <jkosina@suse.cz>,
	Kay Sievers <kay.sievers@suse.de>,
	Mike Frysinger <vapier@gentoo.org>,
	Linux PM mailing list <linux-pm@lists.linux-foundation.org>,
	linux-omap@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/14] ARM / OMAP: Use struct syscore_ops for "core" power management
Date: Sun, 17 Apr 2011 23:08:07 +0200	[thread overview]
Message-ID: <201104172308.08049.rjw@sisk.pl> (raw)
In-Reply-To: <201104172301.54115.rjw@sisk.pl>

From: Rafael J. Wysocki <rjw@sisk.pl>

Replace the sysdev class and struct sys_device used for power
management in the OMAP's GPIO code with a struct syscore_ops object
which is simpler.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Kevin Hilman <khilman@ti.com>
---
 arch/arm/plat-omap/gpio.c |   35 +++++++++--------------------------
 1 file changed, 9 insertions(+), 26 deletions(-)

Index: linux-2.6/arch/arm/plat-omap/gpio.c
===================================================================
--- linux-2.6.orig/arch/arm/plat-omap/gpio.c
+++ linux-2.6/arch/arm/plat-omap/gpio.c
@@ -17,7 +17,7 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
-#include <linux/sysdev.h>
+#include <linux/syscore_ops.h>
 #include <linux/err.h>
 #include <linux/clk.h>
 #include <linux/io.h>
@@ -1372,9 +1372,7 @@ static const struct dev_pm_ops omap_mpui
 	.resume_noirq = omap_mpuio_resume_noirq,
 };
 
-/* use platform_driver for this, now that there's no longer any
- * point to sys_device (other than not disturbing old code).
- */
+/* use platform_driver for this. */
 static struct platform_driver omap_mpuio_driver = {
 	.driver		= {
 		.name	= "mpuio",
@@ -1745,7 +1743,7 @@ static int __devinit omap_gpio_probe(str
 }
 
 #if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS)
-static int omap_gpio_suspend(struct sys_device *dev, pm_message_t mesg)
+static int omap_gpio_suspend(void)
 {
 	int i;
 
@@ -1795,12 +1793,12 @@ static int omap_gpio_suspend(struct sys_
 	return 0;
 }
 
-static int omap_gpio_resume(struct sys_device *dev)
+static void omap_gpio_resume(void)
 {
 	int i;
 
 	if (!cpu_class_is_omap2() && !cpu_is_omap16xx())
-		return 0;
+		return;
 
 	for (i = 0; i < gpio_bank_count; i++) {
 		struct gpio_bank *bank = &gpio_bank[i];
@@ -1836,21 +1834,13 @@ static int omap_gpio_resume(struct sys_d
 		__raw_writel(bank->saved_wakeup, wake_set);
 		spin_unlock_irqrestore(&bank->lock, flags);
 	}
-
-	return 0;
 }
 
-static struct sysdev_class omap_gpio_sysclass = {
-	.name		= "gpio",
+static struct syscore_ops omap_gpio_syscore_ops = {
 	.suspend	= omap_gpio_suspend,
 	.resume		= omap_gpio_resume,
 };
 
-static struct sys_device omap_gpio_device = {
-	.id		= 0,
-	.cls		= &omap_gpio_sysclass,
-};
-
 #endif
 
 #ifdef CONFIG_ARCH_OMAP2PLUS
@@ -2108,21 +2098,14 @@ postcore_initcall(omap_gpio_drv_reg);
 
 static int __init omap_gpio_sysinit(void)
 {
-	int ret = 0;
-
 	mpuio_init();
 
 #if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS)
-	if (cpu_is_omap16xx() || cpu_class_is_omap2()) {
-		if (ret == 0) {
-			ret = sysdev_class_register(&omap_gpio_sysclass);
-			if (ret == 0)
-				ret = sysdev_register(&omap_gpio_device);
-		}
-	}
+	if (cpu_is_omap16xx() || cpu_class_is_omap2())
+		register_syscore_ops(&omap_gpio_syscore_ops);
 #endif
 
-	return ret;
+	return 0;
 }
 
 arch_initcall(omap_gpio_sysinit);

  parent reply	other threads:[~2011-04-17 21:43 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201103280125.11750.rjw@sisk.pl>
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   ` Rafael J. Wysocki [this message]
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=201104172308.08049.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=ben-linux@fluff.org \
    --cc=gregkh@suse.de \
    --cc=gxt@mprc.pku.edu.cn \
    --cc=hans-christian.egtvedt@atmel.com \
    --cc=jeremy.fitzhardinge@citrix.com \
    --cc=jkosina@suse.cz \
    --cc=kay.sievers@suse.de \
    --cc=khilman@ti.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=linux@arm.linux.org.uk \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=ralf@linux-mips.org \
    --cc=vapier@gentoo.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).