[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>

authored by David Woodhouse and committed by Paul Mackerras 36874579 575e3216

+8 -5
+8 -5
drivers/macintosh/macio-adb.c
··· 17 17 #include <asm/irq.h> 18 18 #include <asm/system.h> 19 19 #include <linux/init.h> 20 + #include <linux/ioport.h> 20 21 21 22 struct preg { 22 23 unsigned char r; ··· 89 88 int macio_init(void) 90 89 { 91 90 struct device_node *adbs; 91 + struct resource r; 92 92 93 93 adbs = find_compatible_devices("adb", "chrp,adb0"); 94 94 if (adbs == 0) 95 95 return -ENXIO; 96 96 97 97 #if 0 98 - { int i; 98 + { int i = 0; 99 99 100 100 printk("macio_adb_init: node = %p, addrs =", adbs->node); 101 - for (i = 0; i < adbs->n_addrs; ++i) 102 - printk(" %x(%x)", adbs->addrs[i].address, adbs->addrs[i].size); 101 + while(!of_address_to_resource(adbs, i, &r)) 102 + printk(" %x(%x)", r.start, r.end - r.start); 103 103 printk(", intrs ="); 104 104 for (i = 0; i < adbs->n_intrs; ++i) 105 105 printk(" %x", adbs->intrs[i].line); 106 106 printk("\n"); } 107 107 #endif 108 - 109 - adb = ioremap(adbs->addrs->address, sizeof(struct adb_regs)); 108 + if (of_address_to_resource(adbs, 0, &r)) 109 + return -ENXIO; 110 + adb = ioremap(r.start, sizeof(struct adb_regs)); 110 111 111 112 out_8(&adb->ctrl.r, 0); 112 113 out_8(&adb->intr.r, 0);