diff options
Diffstat (limited to 'arch/sparc64/kernel/sbus.c')
-rw-r--r-- | arch/sparc64/kernel/sbus.c | 16 |
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. */ |
55 | void sbus_set_sbus64(struct sbus_dev *sdev, int bursts) | 55 | void 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: |