aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/ipic.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-05-20 01:36:52 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-05-20 01:36:52 -0400
commit880102e78547c1db158a17e36cf0cdd98e7ad710 (patch)
tree3fff9cc54c44dafe275cfabefb96c589e08d971d /arch/powerpc/sysdev/ipic.c
parent3d07f0e83d4323d2cd45cc583f7cf1957aca3cac (diff)
parent39ab05c8e0b519ff0a04a869f065746e6e8c3d95 (diff)
Merge remote branch 'origin/master' into merge
Manual merge of arch/powerpc/kernel/smp.c and add missing scheduler_ipi() call to arch/powerpc/platforms/cell/interrupt.c Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/sysdev/ipic.c')
-rw-r--r--arch/powerpc/sysdev/ipic.c36
1 files changed, 9 insertions, 27 deletions
diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c
index f0ece79f9be5..7367d17364cb 100644
--- a/arch/powerpc/sysdev/ipic.c
+++ b/arch/powerpc/sysdev/ipic.c
@@ -18,7 +18,7 @@
18#include <linux/stddef.h> 18#include <linux/stddef.h>
19#include <linux/sched.h> 19#include <linux/sched.h>
20#include <linux/signal.h> 20#include <linux/signal.h>
21#include <linux/sysdev.h> 21#include <linux/syscore_ops.h>
22#include <linux/device.h> 22#include <linux/device.h>
23#include <linux/bootmem.h> 23#include <linux/bootmem.h>
24#include <linux/spinlock.h> 24#include <linux/spinlock.h>
@@ -900,7 +900,7 @@ static struct {
900 u32 sercr; 900 u32 sercr;
901} ipic_saved_state; 901} ipic_saved_state;
902 902
903static int ipic_suspend(struct sys_device *sdev, pm_message_t state) 903static int ipic_suspend(void)
904{ 904{
905 struct ipic *ipic = primary_ipic; 905 struct ipic *ipic = primary_ipic;
906 906
@@ -931,7 +931,7 @@ static int ipic_suspend(struct sys_device *sdev, pm_message_t state)
931 return 0; 931 return 0;
932} 932}
933 933
934static int ipic_resume(struct sys_device *sdev) 934static void ipic_resume(void)
935{ 935{
936 struct ipic *ipic = primary_ipic; 936 struct ipic *ipic = primary_ipic;
937 937
@@ -947,44 +947,26 @@ static int ipic_resume(struct sys_device *sdev)
947 ipic_write(ipic->regs, IPIC_SECNR, ipic_saved_state.secnr); 947 ipic_write(ipic->regs, IPIC_SECNR, ipic_saved_state.secnr);
948 ipic_write(ipic->regs, IPIC_SERMR, ipic_saved_state.sermr); 948 ipic_write(ipic->regs, IPIC_SERMR, ipic_saved_state.sermr);
949 ipic_write(ipic->regs, IPIC_SERCR, ipic_saved_state.sercr); 949 ipic_write(ipic->regs, IPIC_SERCR, ipic_saved_state.sercr);
950
951 return 0;
952} 950}
953#else 951#else
954#define ipic_suspend NULL 952#define ipic_suspend NULL
955#define ipic_resume NULL 953#define ipic_resume NULL
956#endif 954#endif
957 955
958static struct sysdev_class ipic_sysclass = { 956static struct syscore_ops ipic_syscore_ops = {
959 .name = "ipic",
960 .suspend = ipic_suspend, 957 .suspend = ipic_suspend,
961 .resume = ipic_resume, 958 .resume = ipic_resume,
962}; 959};
963 960
964static struct sys_device device_ipic = { 961static int __init init_ipic_syscore(void)
965 .id = 0,
966 .cls = &ipic_sysclass,
967};
968
969static int __init init_ipic_sysfs(void)
970{ 962{
971 int rc;
972
973 if (!primary_ipic || !primary_ipic->regs) 963 if (!primary_ipic || !primary_ipic->regs)
974 return -ENODEV; 964 return -ENODEV;
975 printk(KERN_DEBUG "Registering ipic with sysfs...\n");
976 965
977 rc = sysdev_class_register(&ipic_sysclass); 966 printk(KERN_DEBUG "Registering ipic system core operations\n");
978 if (rc) { 967 register_syscore_ops(&ipic_syscore_ops);
979 printk(KERN_ERR "Failed registering ipic sys class\n"); 968
980 return -ENODEV;
981 }
982 rc = sysdev_register(&device_ipic);
983 if (rc) {
984 printk(KERN_ERR "Failed registering ipic sys device\n");
985 return -ENODEV;
986 }
987 return 0; 969 return 0;
988} 970}
989 971
990subsys_initcall(init_ipic_sysfs); 972subsys_initcall(init_ipic_syscore);