powerpc: setup default archdata for {of_}platform via bus_register_notifier
Since a number of powerpc chips are SoCs we end up having dma-able devices that are registered as platform or of_platform devices. We need to hook the archdata to setup proper dma_ops for these devices. Rather than having to add a bus_notify to each platform we add a default one at the highest priority (called first) to set the default dma_ops for of_platform and platform devices to dma_direct_ops. This allows platform code to override the ops by providing their own notifier call back. In the future to enable >4G DMA support on ppc32 we can hook swiotlb ops. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
committed by
Benjamin Herrenschmidt
parent
32ac57668d
commit
d746286c1f
@@ -81,16 +81,6 @@ static int __init qpace_publish_devices(void)
|
||||
}
|
||||
machine_subsys_initcall(qpace, qpace_publish_devices);
|
||||
|
||||
extern int qpace_notify(struct device *dev)
|
||||
{
|
||||
/* set dma_ops for of_platform bus */
|
||||
if (dev->bus && dev->bus->name
|
||||
&& !strcmp(dev->bus->name, "of_platform"))
|
||||
set_dma_ops(dev, &dma_direct_ops);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __init qpace_setup_arch(void)
|
||||
{
|
||||
#ifdef CONFIG_SPU_BASE
|
||||
@@ -115,9 +105,6 @@ static void __init qpace_setup_arch(void)
|
||||
#ifdef CONFIG_DUMMY_CONSOLE
|
||||
conswitchp = &dummy_con;
|
||||
#endif
|
||||
|
||||
/* set notifier function */
|
||||
platform_notify = &qpace_notify;
|
||||
}
|
||||
|
||||
static int __init qpace_probe(void)
|
||||
|
Reference in New Issue
Block a user