aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh/rack-meter.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/macintosh/rack-meter.c')
-rw-r--r--drivers/macintosh/rack-meter.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/macintosh/rack-meter.c b/drivers/macintosh/rack-meter.c
index 1f29d2413c74..3940e2a032f7 100644
--- a/drivers/macintosh/rack-meter.c
+++ b/drivers/macintosh/rack-meter.c
@@ -376,18 +376,19 @@ static int rackmeter_probe(struct macio_dev* mdev,
376 pr_debug("rackmeter_probe()\n"); 376 pr_debug("rackmeter_probe()\n");
377 377
378 /* Get i2s-a node */ 378 /* Get i2s-a node */
379 while ((i2s = of_get_next_child(mdev->ofdev.dev.of_node, i2s)) != NULL) 379 for_each_child_of_node(mdev->ofdev.dev.of_node, i2s)
380 if (strcmp(i2s->name, "i2s-a") == 0) 380 if (of_node_name_eq(i2s, "i2s-a"))
381 break; 381 break;
382
382 if (i2s == NULL) { 383 if (i2s == NULL) {
383 pr_debug(" i2s-a child not found\n"); 384 pr_debug(" i2s-a child not found\n");
384 goto bail; 385 goto bail;
385 } 386 }
386 /* Get lightshow or virtual sound */ 387 /* Get lightshow or virtual sound */
387 while ((np = of_get_next_child(i2s, np)) != NULL) { 388 for_each_child_of_node(i2s, np) {
388 if (strcmp(np->name, "lightshow") == 0) 389 if (of_node_name_eq(np, "lightshow"))
389 break; 390 break;
390 if ((strcmp(np->name, "sound") == 0) && 391 if (of_node_name_eq(np, "sound") &&
391 of_get_property(np, "virtual", NULL) != NULL) 392 of_get_property(np, "virtual", NULL) != NULL)
392 break; 393 break;
393 } 394 }