public inbox for linuxppc-dev@ozlabs.org 
 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 9/14] PM / Blackfin: Use struct syscore_ops instead of sysdevs for PM
Date: Sun, 17 Apr 2011 23:11:58 +0200	[thread overview]
Message-ID: <201104172311.59289.rjw@sisk.pl> (raw)
In-Reply-To: <201104172301.54115.rjw@sisk.pl>

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

Convert some Blackfin architecture's code to using 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>
---
 arch/blackfin/kernel/nmi.c |   30 +++++++++---------------------
 1 file changed, 9 insertions(+), 21 deletions(-)

Index: linux-2.6/arch/blackfin/kernel/nmi.c
===================================================================
--- linux-2.6.orig/arch/blackfin/kernel/nmi.c
+++ linux-2.6/arch/blackfin/kernel/nmi.c
@@ -12,7 +12,7 @@
 
 #include <linux/bitops.h>
 #include <linux/hardirq.h>
-#include <linux/sysdev.h>
+#include <linux/syscore_ops.h>
 #include <linux/pm.h>
 #include <linux/nmi.h>
 #include <linux/smp.h>
@@ -196,43 +196,31 @@ void touch_nmi_watchdog(void)
 
 /* Suspend/resume support */
 #ifdef CONFIG_PM
-static int nmi_wdt_suspend(struct sys_device *dev, pm_message_t state)
+static int nmi_wdt_suspend(void)
 {
 	nmi_wdt_stop();
 	return 0;
 }
 
-static int nmi_wdt_resume(struct sys_device *dev)
+static void nmi_wdt_resume(void)
 {
 	if (nmi_active)
 		nmi_wdt_start();
-	return 0;
 }
 
-static struct sysdev_class nmi_sysclass = {
-	.name		= DRV_NAME,
+static struct syscore_ops nmi_syscore_ops = {
 	.resume		= nmi_wdt_resume,
 	.suspend	= nmi_wdt_suspend,
 };
 
-static struct sys_device device_nmi_wdt = {
-	.id	= 0,
-	.cls	= &nmi_sysclass,
-};
-
-static int __init init_nmi_wdt_sysfs(void)
+static int __init init_nmi_wdt_syscore(void)
 {
-	int error;
-
-	if (!nmi_active)
-		return 0;
+	if (nmi_active)
+		register_syscore_ops(&nmi_syscore_ops);
 
-	error = sysdev_class_register(&nmi_sysclass);
-	if (!error)
-		error = sysdev_register(&device_nmi_wdt);
-	return error;
+	return 0;
 }
-late_initcall(init_nmi_wdt_sysfs);
+late_initcall(init_nmi_wdt_syscore);
 
 #endif	/* CONFIG_PM */
 

  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   ` [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   ` Rafael J. Wysocki [this message]
2011-04-18  2:34     ` [PATCH 9/14] PM / Blackfin: Use struct syscore_ops instead of sysdevs for PM 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=201104172311.59289.rjw@sisk.pl \
    --to=rjw@sisk$(echo .)pl \
    --cc=ben-linux@fluff$(echo .)org \
    --cc=gregkh@suse$(echo .)de \
    --cc=gxt@mprc$(echo .)pku.edu.cn \
    --cc=hans-christian.egtvedt@atmel$(echo .)com \
    --cc=jeremy.fitzhardinge@citrix$(echo .)com \
    --cc=jkosina@suse$(echo .)cz \
    --cc=kay.sievers@suse$(echo .)de \
    --cc=khilman@ti$(echo .)com \
    --cc=konrad.wilk@oracle$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-omap@vger$(echo .)kernel.org \
    --cc=linux-pm@lists$(echo .)linux-foundation.org \
    --cc=linux@arm$(echo .)linux.org.uk \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=ralf@linux-mips$(echo .)org \
    --cc=vapier@gentoo$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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