Commit 84652e83 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

PM / MIPS: Convert i8259.c to using syscore_ops

The code in arch/mips/kernel/i8259.c still hasn't been converted to
using struct syscore_ops instead of a sysdev for resume and shutdown.
As a result, this code doesn't build any more after suspend, resume
and shutdown callbacks have been removed from struct sysdev_class.
Fix this problem by converting i8259.c to using syscore_ops.
Reported-and-tested-by: default avatarRoland Vossen <rvossen@broadcom.com>
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Acked-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 3110df80
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/sysdev.h> #include <linux/syscore_ops.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <asm/i8259.h> #include <asm/i8259.h>
...@@ -215,14 +215,13 @@ static void mask_and_ack_8259A(struct irq_data *d) ...@@ -215,14 +215,13 @@ static void mask_and_ack_8259A(struct irq_data *d)
} }
} }
static int i8259A_resume(struct sys_device *dev) static void i8259A_resume(void)
{ {
if (i8259A_auto_eoi >= 0) if (i8259A_auto_eoi >= 0)
init_8259A(i8259A_auto_eoi); 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 /* Put the i8259A into a quiescent state that
* the kernel initialization code can get it * the kernel initialization code can get it
...@@ -232,26 +231,17 @@ static int i8259A_shutdown(struct sys_device *dev) ...@@ -232,26 +231,17 @@ static int i8259A_shutdown(struct sys_device *dev)
outb(0xff, PIC_MASTER_IMR); /* mask all of 8259A-1 */ outb(0xff, PIC_MASTER_IMR); /* mask all of 8259A-1 */
outb(0xff, PIC_SLAVE_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 = { static struct syscore_ops i8259_syscore_ops = {
.name = "i8259",
.resume = i8259A_resume, .resume = i8259A_resume,
.shutdown = i8259A_shutdown, .shutdown = i8259A_shutdown,
}; };
static struct sys_device device_i8259A = {
.id = 0,
.cls = &i8259_sysdev_class,
};
static int __init i8259A_init_sysfs(void) static int __init i8259A_init_sysfs(void)
{ {
int error = sysdev_class_register(&i8259_sysdev_class); register_syscore_ops(&i8259_syscore_ops);
if (!error) return 0;
error = sysdev_register(&device_i8259A);
return error;
} }
device_initcall(i8259A_init_sysfs); device_initcall(i8259A_init_sysfs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment