summaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorKristoffer Glembo <kristoffer@gaisler.com>2011-01-18 04:10:26 +0000
committerDavid S. Miller <davem@davemloft.net>2011-03-16 18:18:58 -0700
commit1830474696bb01a77a3cfff477c34e0aa087ecce (patch)
tree281c3273fc6cfa0956f74095a71eb23838c7d992 /arch/sparc
parentb8682cefb861c61ced6ca2300a5ef96e91c6dbff (diff)
downloadop-kernel-dev-1830474696bb01a77a3cfff477c34e0aa087ecce.zip
op-kernel-dev-1830474696bb01a77a3cfff477c34e0aa087ecce.tar.gz
sparc/leon: Add LEON dma_ops.
This patch sets the dma_ops structure for LEON. It reuses the pci32_dma_ops. Signed-off-by: Kristoffer Glembo <kristoffer@gaisler.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/kernel/ioport.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c
index 1b9f07c..b817481 100644
--- a/arch/sparc/kernel/ioport.c
+++ b/arch/sparc/kernel/ioport.c
@@ -409,9 +409,6 @@ struct dma_map_ops sbus_dma_ops = {
.sync_sg_for_device = sbus_sync_sg_for_device,
};
-struct dma_map_ops *dma_ops = &sbus_dma_ops;
-EXPORT_SYMBOL(dma_ops);
-
static int __init sparc_register_ioport(void)
{
register_proc_sparc_ioport();
@@ -423,7 +420,9 @@ arch_initcall(sparc_register_ioport);
#endif /* CONFIG_SBUS */
-#ifdef CONFIG_PCI
+
+/* LEON reuses PCI DMA ops */
+#if defined(CONFIG_PCI) || defined(CONFIG_SPARC_LEON)
/* Allocate and map kernel buffer using consistent mode DMA for a device.
* hwdev should be valid struct pci_dev pointer for PCI devices.
@@ -663,7 +662,16 @@ struct dma_map_ops pci32_dma_ops = {
};
EXPORT_SYMBOL(pci32_dma_ops);
-#endif /* CONFIG_PCI */
+#endif /* CONFIG_PCI || CONFIG_SPARC_LEON */
+
+#ifdef CONFIG_SPARC_LEON
+struct dma_map_ops *dma_ops = &pci32_dma_ops;
+#elif defined(CONFIG_SBUS)
+struct dma_map_ops *dma_ops = &sbus_dma_ops;
+#endif
+
+EXPORT_SYMBOL(dma_ops);
+
/*
* Return whether the given PCI device DMA address mask can be
OpenPOWER on IntegriCloud