Skip to content

Commit 3687457

Browse files
dwmw2paulusmack
authored andcommitted
[PATCH] powerpc: macio-adb build fix
This makes macio-adb.c build again. Entirely untested. Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
1 parent 575e321 commit 3687457

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

‎drivers/macintosh/macio-adb.c‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <asm/irq.h>
1818
#include <asm/system.h>
1919
#include <linux/init.h>
20+
#include <linux/ioport.h>
2021

2122
struct preg {
2223
unsigned char r;
@@ -88,24 +89,26 @@ int macio_probe(void)
8889
int macio_init(void)
8990
{
9091
struct device_node *adbs;
92+
struct resource r;
9193

9294
adbs = find_compatible_devices("adb", "chrp,adb0");
9395
if (adbs == 0)
9496
return -ENXIO;
9597

9698
#if 0
97-
{ int i;
99+
{ int i = 0;
98100

99101
printk("macio_adb_init: node = %p, addrs =", adbs->node);
100-
for (i = 0; i < adbs->n_addrs; ++i)
101-
printk(" %x(%x)", adbs->addrs[i].address, adbs->addrs[i].size);
102+
while(!of_address_to_resource(adbs, i, &r))
103+
printk(" %x(%x)", r.start, r.end - r.start);
102104
printk(", intrs =");
103105
for (i = 0; i < adbs->n_intrs; ++i)
104106
printk(" %x", adbs->intrs[i].line);
105107
printk("\n"); }
106108
#endif
107-
108-
adb = ioremap(adbs->addrs->address, sizeof(struct adb_regs));
109+
if (of_address_to_resource(adbs, 0, &r))
110+
return -ENXIO;
111+
adb = ioremap(r.start, sizeof(struct adb_regs));
109112

110113
out_8(&adb->ctrl.r, 0);
111114
out_8(&adb->intr.r, 0);

0 commit comments

Comments
 (0)