powerpc: make use of for_each_node_by_type() instead of open-coding it
Instead of manually coding the loop with of_find_node_by_type(), let's switch to the standard macro for iterating over nodes with given type. Also fixed a couple of refcount leaks in the aforementioned loops. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Šī revīzija ir iekļauta:

revīziju iesūtīja
Michael Ellerman

vecāks
94d3084a0f
revīzija
9625e69a38
@@ -292,12 +292,12 @@ static int __init of_enumerate_spus(int (*fn)(void *data))
|
||||
unsigned int n = 0;
|
||||
|
||||
ret = -ENODEV;
|
||||
for (node = of_find_node_by_type(NULL, "spe");
|
||||
node; node = of_find_node_by_type(node, "spe")) {
|
||||
for_each_node_by_type(node, "spe") {
|
||||
ret = fn(node);
|
||||
if (ret) {
|
||||
printk(KERN_WARNING "%s: Error initializing %s\n",
|
||||
__func__, node->name);
|
||||
of_node_put(node);
|
||||
break;
|
||||
}
|
||||
n++;
|
||||
|
Atsaukties uz šo jaunā problēmā
Block a user