aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/kernel/setup-common.c36
-rw-r--r--arch/powerpc/platforms/cell/qpace_setup.c13
2 files changed, 36 insertions, 13 deletions
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 705fc4bf3800..9774f9fed96e 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -35,6 +35,8 @@
35#include <linux/debugfs.h> 35#include <linux/debugfs.h>
36#include <linux/percpu.h> 36#include <linux/percpu.h>
37#include <linux/lmb.h> 37#include <linux/lmb.h>
38#include <linux/of_platform.h>
39#include <linux/platform_device.h>
38#include <asm/io.h> 40#include <asm/io.h>
39#include <asm/prom.h> 41#include <asm/prom.h>
40#include <asm/processor.h> 42#include <asm/processor.h>
@@ -669,3 +671,37 @@ static int powerpc_debugfs_init(void)
669} 671}
670arch_initcall(powerpc_debugfs_init); 672arch_initcall(powerpc_debugfs_init);
671#endif 673#endif
674
675static int ppc_dflt_bus_notify(struct notifier_block *nb,
676 unsigned long action, void *data)
677{
678 struct device *dev = data;
679
680 /* We are only intereted in device addition */
681 if (action != BUS_NOTIFY_ADD_DEVICE)
682 return 0;
683
684 set_dma_ops(dev, &dma_direct_ops);
685
686 return NOTIFY_DONE;
687}
688
689static struct notifier_block ppc_dflt_plat_bus_notifier = {
690 .notifier_call = ppc_dflt_bus_notify,
691 .priority = INT_MAX,
692};
693
694static struct notifier_block ppc_dflt_of_bus_notifier = {
695 .notifier_call = ppc_dflt_bus_notify,
696 .priority = INT_MAX,
697};
698
699static int __init setup_bus_notifier(void)
700{
701 bus_register_notifier(&platform_bus_type, &ppc_dflt_plat_bus_notifier);
702 bus_register_notifier(&of_platform_bus_type, &ppc_dflt_of_bus_notifier);
703
704 return 0;
705}
706
707arch_initcall(setup_bus_notifier);
diff --git a/arch/powerpc/platforms/cell/qpace_setup.c b/arch/powerpc/platforms/cell/qpace_setup.c
index c75b66278fa2..c5ce02e84c8e 100644
--- a/arch/powerpc/platforms/cell/qpace_setup.c
+++ b/arch/powerpc/platforms/cell/qpace_setup.c
@@ -81,16 +81,6 @@ static int __init qpace_publish_devices(void)
81} 81}
82machine_subsys_initcall(qpace, qpace_publish_devices); 82machine_subsys_initcall(qpace, qpace_publish_devices);
83 83
84extern int qpace_notify(struct device *dev)
85{
86 /* set dma_ops for of_platform bus */
87 if (dev->bus && dev->bus->name
88 && !strcmp(dev->bus->name, "of_platform"))
89 set_dma_ops(dev, &dma_direct_ops);
90
91 return 0;
92}
93
94static void __init qpace_setup_arch(void) 84static void __init qpace_setup_arch(void)
95{ 85{
96#ifdef CONFIG_SPU_BASE 86#ifdef CONFIG_SPU_BASE
@@ -115,9 +105,6 @@ static void __init qpace_setup_arch(void)
115#ifdef CONFIG_DUMMY_CONSOLE 105#ifdef CONFIG_DUMMY_CONSOLE
116 conswitchp = &dummy_con; 106 conswitchp = &dummy_con;
117#endif 107#endif
118
119 /* set notifier function */
120 platform_notify = &qpace_notify;
121} 108}
122 109
123static int __init qpace_probe(void) 110static int __init qpace_probe(void)