public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pengfei Zhang <zoppof.zhang@gmail.com>
To: Ralf Baechle <ralf@linux-mips.org>, Thomas Gleixner <tglx@linutronix.de>
Cc: linux-mips@linux-mips.org, linux-kernel@vger.kernel.org,
	Pengfei Zhang <zoppof.zhang@gmail.com>
Subject: [PATCH] MIPS:i8259.c remove resume and shutdown to syscore_ops
Date: Tue, 24 May 2011 20:19:18 +0800	[thread overview]
Message-ID: <1306239558-4997-1-git-send-email-zoppof.zhang@gmail.com> (raw)

Remove the resume and shutdown of i8259A from the sysdev_class
to the syscore_ops since these members had removed from the
structure sysdev_class.

Signed-off-by: Pengfei Zhang <zoppof.zhang@gmail.com>
---
 arch/mips/kernel/i8259.c |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/arch/mips/kernel/i8259.c b/arch/mips/kernel/i8259.c
index c018696..a74a8ea 100644
--- a/arch/mips/kernel/i8259.c
+++ b/arch/mips/kernel/i8259.c
@@ -16,6 +16,7 @@
 #include <linux/spinlock.h>
 #include <linux/sysdev.h>
 #include <linux/irq.h>
+#include <linux/syscore_ops.h>
 
 #include <asm/i8259.h>
 #include <asm/io.h>
@@ -215,14 +216,13 @@ spurious_8259A_irq:
 	}
 }
 
-static int i8259A_resume(struct sys_device *dev)
+static void i8259A_resume(void)
 {
 	if (i8259A_auto_eoi >= 0)
 		init_8259A(i8259A_auto_eoi);
-	return 0;
 }
 
-static int i8259A_shutdown(struct sys_device *dev)
+static void i8259A_shutdown(void)
 {
 	/* Put the i8259A into a quiescent state that
 	 * the kernel initialization code can get it
@@ -232,15 +232,17 @@ static int i8259A_shutdown(struct sys_device *dev)
 		outb(0xff, PIC_MASTER_IMR);	/* mask all of 8259A-1 */
 		outb(0xff, PIC_SLAVE_IMR);	/* mask all of 8259A-1 */
 	}
-	return 0;
 }
 
-static struct sysdev_class i8259_sysdev_class = {
-	.name = "i8259",
+static struct syscore_ops i8259_syscore_ops = {
 	.resume = i8259A_resume,
 	.shutdown = i8259A_shutdown,
 };
 
+static struct sysdev_class i8259_sysdev_class = {
+	.name = "i8259",
+};
+
 static struct sys_device device_i8259A = {
 	.id	= 0,
 	.cls	= &i8259_sysdev_class,
@@ -248,7 +250,11 @@ static struct sys_device device_i8259A = {
 
 static int __init i8259A_init_sysfs(void)
 {
-	int error = sysdev_class_register(&i8259_sysdev_class);
+	int error;
+
+	register_syscore_ops(&i8259_syscore_ops);
+
+	error = sysdev_class_register(&i8259_sysdev_class);
 	if (!error)
 		error = sysdev_register(&device_i8259A);
 	return error;
-- 
1.7.4.1


             reply	other threads:[~2011-05-24 12:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-24 12:19 Pengfei Zhang [this message]
2011-05-24 13:59 ` [PATCH] MIPS:i8259.c remove resume and shutdown to syscore_ops Ralf Baechle
2011-05-24 14:01   ` Thomas Gleixner
  -- strict thread matches above, loose matches on Subject: below --
2011-05-24 14:25 Wanlong Gao
2011-05-24 18:59 ` Rafael J. Wysocki
2011-05-24 19:09   ` Manuel Lauss
2011-05-24 23:14   ` Wanlong Gao

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=1306239558-4997-1-git-send-email-zoppof.zhang@gmail.com \
    --to=zoppof.zhang@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=tglx@linutronix.de \
    /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