forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/arch/powerpc/platforms/powermac/pfunc_base.c
....@@ -101,9 +101,8 @@
101101 * Find the "gpio" parent node
102102 */
103103
104
- for (gparent = NULL;
105
- (gparent = of_get_next_child(macio->of_node, gparent)) != NULL;)
106
- if (strcmp(gparent->name, "gpio") == 0)
104
+ for_each_child_of_node(macio->of_node, gparent)
105
+ if (of_node_name_eq(gparent, "gpio"))
107106 break;
108107 if (gparent == NULL)
109108 return;
....@@ -115,7 +114,7 @@
115114 * Ok, got one, we dont need anything special to track them down, so
116115 * we just create them all
117116 */
118
- for (gp = NULL; (gp = of_get_next_child(gparent, gp)) != NULL;) {
117
+ for_each_child_of_node(gparent, gp) {
119118 const u32 *reg = of_get_property(gp, "reg", NULL);
120119 unsigned long offset;
121120 if (reg == NULL)
....@@ -134,7 +133,7 @@
134133 macio->of_node);
135134
136135 /* And now we run all the init ones */
137
- for (gp = NULL; (gp = of_get_next_child(gparent, gp)) != NULL;)
136
+ for_each_child_of_node(gparent, gp)
138137 pmf_do_functions(gp, NULL, 0, PMF_FLAGS_ON_INIT, NULL);
139138
140139 /* Note: We do not at this point implement the "at sleep" or "at wake"
....@@ -313,7 +312,7 @@
313312 * Install handlers for the hwclock child if any
314313 */
315314 for (np = NULL; (np = of_get_next_child(uninorth_node, np)) != NULL;)
316
- if (strcmp(np->name, "hw-clock") == 0) {
315
+ if (of_node_name_eq(np, "hw-clock")) {
317316 unin_hwclock = np;
318317 break;
319318 }