summaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/sbus.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-08-26 23:33:42 -0700
committerDavid S. Miller <davem@davemloft.net>2008-08-29 02:13:31 -0700
commit63237eeb5ac92d618a0a6055f4b1f65c5d14682b (patch)
tree3d44dea70077557a7543951580447dbb71d00b05 /arch/sparc64/kernel/sbus.c
parent738f2b7b813913e651f39387d007dd961755dee2 (diff)
downloadlinux-63237eeb5ac92d618a0a6055f4b1f65c5d14682b.tar.gz
linux-63237eeb5ac92d618a0a6055f4b1f65c5d14682b.tar.bz2
linux-63237eeb5ac92d618a0a6055f4b1f65c5d14682b.zip
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 @@
#define STRBUF_TAG_VALID 0x02UL
/* Enable 64-bit DVMA mode for the given device. */
-void sbus_set_sbus64(struct sbus_dev *sdev, int bursts)
+void sbus_set_sbus64(struct device *dev, int bursts)
{
- struct iommu *iommu = sdev->ofdev.dev.archdata.iommu;
- int slot = sdev->slot;
+ struct iommu *iommu = dev->archdata.iommu;
+ struct of_device *op = to_of_device(dev);
+ const struct linux_prom_registers *regs;
unsigned long cfg_reg;
+ int slot;
u64 val;
+ regs = of_get_property(op->node, "reg", NULL);
+ if (!regs) {
+ printk(KERN_ERR "sbus_set_sbus64: Cannot find regs for %s\n",
+ op->node->full_name);
+ return;
+ }
+ slot = regs->which_io;
+
cfg_reg = iommu->write_complete_reg;
switch (slot) {
case 0: