]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/platforms/powermac/time.c
[PATCH] powerpc: Remove device_node addrs/n_addr
[linux-2.6-omap-h63xx.git] / arch / powerpc / platforms / powermac / time.c
index feb0a94e78192e28010b6635473e45780a0a3862..5d9afa1fa02d0d6d9262040716425852a73753a5 100644 (file)
@@ -258,15 +258,20 @@ int __init via_calibrate_decr(void)
        volatile unsigned char __iomem *via;
        int count = VIA_TIMER_FREQ_6 / 100;
        unsigned int dstart, dend;
+       struct resource rsrc;
 
-       vias = find_devices("via-cuda");
+       vias = of_find_node_by_name(NULL, "via-cuda");
        if (vias == 0)
-               vias = find_devices("via-pmu");
+               vias = of_find_node_by_name(NULL, "via-pmu");
        if (vias == 0)
-               vias = find_devices("via");
-       if (vias == 0 || vias->n_addrs == 0)
+               vias = of_find_node_by_name(NULL, "via");
+       if (vias == 0 || of_address_to_resource(vias, 0, &rsrc))
                return 0;
-       via = ioremap(vias->addrs[0].address, vias->addrs[0].size);
+       via = ioremap(rsrc.start, rsrc.end - rsrc.start + 1);
+       if (via == NULL) {
+               printk(KERN_ERR "Failed to map VIA for timer calibration !\n");
+               return 0;
+       }
 
        /* set timer 1 for continuous interrupts */
        out_8(&via[ACR], (via[ACR] & ~T1MODE) | T1MODE_CONT);