aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/sbus.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-08-27 02:33:42 -0400
committerDavid S. Miller <davem@davemloft.net>2008-08-29 05:13:31 -0400
commit63237eeb5ac92d618a0a6055f4b1f65c5d14682b (patch)
tree3d44dea70077557a7543951580447dbb71d00b05 /arch/sparc64/kernel/sbus.c
parent738f2b7b813913e651f39387d007dd961755dee2 (diff)
sparc: Move SBUS DMA attribute interfaces out of asm/sbus.h
This is in preparation for the subsequent asm/sbus.h removal. Also, make these routines take a "struct device" or no arguments, as appropriate. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/sbus.c')
-rw-r--r--arch/sparc64/kernel/sbus.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/arch/sparc64/kernel/sbus.c b/arch/sparc64/kernel/sbus.c
index e33a8a660e9e..aa47022e13f3 100644
--- a/arch/sparc64/kernel/sbus.c
+++ b/arch/sparc64/kernel/sbus.c
@@ -52,13 +52,23 @@
52#define STRBUF_TAG_VALID 0x02UL 52#define STRBUF_TAG_VALID 0x02UL
53 53
54/* Enable 64-bit DVMA mode for the given device. */ 54/* Enable 64-bit DVMA mode for the given device. */
55void sbus_set_sbus64(struct sbus_dev *sdev, int bursts) 55void sbus_set_sbus64(struct device *dev, int bursts)
56{ 56{
57 struct iommu *iommu = sdev->ofdev.dev.archdata.iommu; 57 struct iommu *iommu = dev->archdata.iommu;
58 int slot = sdev->slot; 58 struct of_device *op = to_of_device(dev);
59 const struct linux_prom_registers *regs;
59 unsigned long cfg_reg; 60 unsigned long cfg_reg;
61 int slot;
60 u64 val; 62 u64 val;
61 63
64 regs = of_get_property(op->node, "reg", NULL);
65 if (!regs) {
66 printk(KERN_ERR "sbus_set_sbus64: Cannot find regs for %s\n",
67 op->node->full_name);
68 return;
69 }
70 slot = regs->which_io;
71
62 cfg_reg = iommu->write_complete_reg; 72 cfg_reg = iommu->write_complete_reg;
63 switch (slot) { 73 switch (slot) {
64 case 0: 74 case 0: