public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS:i8259.c remove resume and shutdown to syscore_ops
@ 2011-05-24 12:19 Pengfei Zhang
  2011-05-24 13:59 ` Ralf Baechle
  0 siblings, 1 reply; 7+ messages in thread
From: Pengfei Zhang @ 2011-05-24 12:19 UTC (permalink / raw)
  To: Ralf Baechle, Thomas Gleixner; +Cc: linux-mips, linux-kernel, Pengfei Zhang

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [PATCH] MIPS:i8259.c remove resume and shutdown to syscore_ops
@ 2011-05-24 14:25 Wanlong Gao
  2011-05-24 18:59 ` Rafael J. Wysocki
  0 siblings, 1 reply; 7+ messages in thread
From: Wanlong Gao @ 2011-05-24 14:25 UTC (permalink / raw)
  To: Ralf Baechle, Thomas Gleixner; +Cc: linux-mips, linux-kernel, Pengfei Zhang


> On Tue, May 24, 2011 at 08:19:18PM +0800, Pengfei Zhang wrote:
> 
> > 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.
> 
> I don't see why one would want to want to first call
> register_syscore_ops
> then sysdev_class_register and sysdev_register?
> 
Hi Ralf:
If these not moved to syscore_ops, building will get error.

Hi Thomas:
Does you mean that we can just remove the sysfs entry now ?


Thanks
Best regards

Wanlong Gao


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-05-24 23:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-24 12:19 [PATCH] MIPS:i8259.c remove resume and shutdown to syscore_ops Pengfei Zhang
2011-05-24 13:59 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox