diff options
Diffstat (limited to 'arch/powerpc/kernel/setup-common.c')
-rw-r--r-- | arch/powerpc/kernel/setup-common.c | 36 |
1 files changed, 36 insertions, 0 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 | } |
670 | arch_initcall(powerpc_debugfs_init); | 672 | arch_initcall(powerpc_debugfs_init); |
671 | #endif | 673 | #endif |
674 | |||
675 | static 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 | |||
689 | static struct notifier_block ppc_dflt_plat_bus_notifier = { | ||
690 | .notifier_call = ppc_dflt_bus_notify, | ||
691 | .priority = INT_MAX, | ||
692 | }; | ||
693 | |||
694 | static struct notifier_block ppc_dflt_of_bus_notifier = { | ||
695 | .notifier_call = ppc_dflt_bus_notify, | ||
696 | .priority = INT_MAX, | ||
697 | }; | ||
698 | |||
699 | static 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 | |||
707 | arch_initcall(setup_bus_notifier); | ||