aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/powermac/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/powermac/time.c')
-rw-r--r--arch/powerpc/platforms/powermac/time.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/powermac/time.c b/arch/powerpc/platforms/powermac/time.c
index 59eb840d8ce2..1810e4226e56 100644
--- a/arch/powerpc/platforms/powermac/time.c
+++ b/arch/powerpc/platforms/powermac/time.c
@@ -265,12 +265,15 @@ int __init via_calibrate_decr(void)
265 struct resource rsrc; 265 struct resource rsrc;
266 266
267 vias = of_find_node_by_name(NULL, "via-cuda"); 267 vias = of_find_node_by_name(NULL, "via-cuda");
268 if (vias == 0) 268 if (vias == NULL)
269 vias = of_find_node_by_name(NULL, "via-pmu"); 269 vias = of_find_node_by_name(NULL, "via-pmu");
270 if (vias == 0) 270 if (vias == NULL)
271 vias = of_find_node_by_name(NULL, "via"); 271 vias = of_find_node_by_name(NULL, "via");
272 if (vias == 0 || of_address_to_resource(vias, 0, &rsrc)) 272 if (vias == NULL || of_address_to_resource(vias, 0, &rsrc)) {
273 of_node_put(vias);
273 return 0; 274 return 0;
275 }
276 of_node_put(vias);
274 via = ioremap(rsrc.start, rsrc.end - rsrc.start + 1); 277 via = ioremap(rsrc.start, rsrc.end - rsrc.start + 1);
275 if (via == NULL) { 278 if (via == NULL) {
276 printk(KERN_ERR "Failed to map VIA for timer calibration !\n"); 279 printk(KERN_ERR "Failed to map VIA for timer calibration !\n");
@@ -297,7 +300,7 @@ int __init via_calibrate_decr(void)
297 ppc_tb_freq = (dstart - dend) * 100 / 6; 300 ppc_tb_freq = (dstart - dend) * 100 / 6;
298 301
299 iounmap(via); 302 iounmap(via);
300 303
301 return 1; 304 return 1;
302} 305}
303#endif 306#endif