summaryrefslogtreecommitdiff
path: root/arch/powerpc
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2011-07-08 00:17:27 -0500
committerKumar Gala <galak@kernel.crashing.org>2011-07-08 00:21:36 -0500
commit314b02f503c2c219fde0fcf6f086fda415f8a847 (patch)
tree7f41ae421e6cb11d821175465b1346851a600292 /arch/powerpc
parenta77ce8167cc1d0370fcb1d79b367d62e050cb2b0 (diff)
downloadlinux-3.10-314b02f503c2c219fde0fcf6f086fda415f8a847.tar.gz
linux-3.10-314b02f503c2c219fde0fcf6f086fda415f8a847.tar.bz2
linux-3.10-314b02f503c2c219fde0fcf6f086fda415f8a847.zip
powerpc: implement arch_setup_pdev_archdata
We have a long standing issues with platform devices not have a valid dma_mask pointer. This hasn't been an issue to date as no platform device has tried to set its dma_mask value to a non-default value. Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kernel/setup-common.c28
1 files changed, 4 insertions, 24 deletions
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index e053b1641de..c600faf114d 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -709,29 +709,9 @@ void ppc_printk_progress(char *s, unsigned short hex)
pr_info("%s\n", s);
}
-static int ppc_dflt_bus_notify(struct notifier_block *nb,
- unsigned long action, void *data)
+void arch_setup_pdev_archdata(struct platform_device *pdev)
{
- struct device *dev = data;
-
- /* We are only intereted in device addition */
- if (action != BUS_NOTIFY_ADD_DEVICE)
- return 0;
-
- set_dma_ops(dev, &dma_direct_ops);
-
- return NOTIFY_DONE;
-}
-
-static struct notifier_block ppc_dflt_plat_bus_notifier = {
- .notifier_call = ppc_dflt_bus_notify,
- .priority = INT_MAX,
-};
-
-static int __init setup_bus_notifier(void)
-{
- bus_register_notifier(&platform_bus_type, &ppc_dflt_plat_bus_notifier);
- return 0;
+ pdev->archdata.dma_mask = DMA_BIT_MASK(32);
+ pdev->dev.dma_mask = &pdev->archdata.dma_mask;
+ set_dma_ops(&pdev->dev, &dma_direct_ops);
}
-
-arch_initcall(setup_bus_notifier);