aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMariusz Kozlowski <m.kozlowski@tuxland.pl>2007-01-02 06:31:47 -0500
committerPaul Mackerras <paulus@samba.org>2007-01-24 05:13:57 -0500
commitb1374051433cc252540058e8a90107c90fa23eb4 (patch)
tree16b9f6ae5b0a3d874bcebc57755279c3c6569fa5 /arch
parenta2894cfb3a6d60980ba85181e31ccc079807e92b (diff)
[POWERPC] arch/ppc/kernel/prom.c of_node_(get|put) cleanup
Remove redundant argument checks for of_node_get() and of_node_put(). Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kernel/prom.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 1fc732a552db..3be52d693eca 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1221,8 +1221,7 @@ struct device_node *of_find_node_by_name(struct device_node *from,
1221 if (np->name != NULL && strcasecmp(np->name, name) == 0 1221 if (np->name != NULL && strcasecmp(np->name, name) == 0
1222 && of_node_get(np)) 1222 && of_node_get(np))
1223 break; 1223 break;
1224 if (from) 1224 of_node_put(from);
1225 of_node_put(from);
1226 read_unlock(&devtree_lock); 1225 read_unlock(&devtree_lock);
1227 return np; 1226 return np;
1228} 1227}
@@ -1250,8 +1249,7 @@ struct device_node *of_find_node_by_type(struct device_node *from,
1250 if (np->type != 0 && strcasecmp(np->type, type) == 0 1249 if (np->type != 0 && strcasecmp(np->type, type) == 0
1251 && of_node_get(np)) 1250 && of_node_get(np))
1252 break; 1251 break;
1253 if (from) 1252 of_node_put(from);
1254 of_node_put(from);
1255 read_unlock(&devtree_lock); 1253 read_unlock(&devtree_lock);
1256 return np; 1254 return np;
1257} 1255}
@@ -1285,8 +1283,7 @@ struct device_node *of_find_compatible_node(struct device_node *from,
1285 if (device_is_compatible(np, compatible) && of_node_get(np)) 1283 if (device_is_compatible(np, compatible) && of_node_get(np))
1286 break; 1284 break;
1287 } 1285 }
1288 if (from) 1286 of_node_put(from);
1289 of_node_put(from);
1290 read_unlock(&devtree_lock); 1287 read_unlock(&devtree_lock);
1291 return np; 1288 return np;
1292} 1289}
@@ -1329,8 +1326,7 @@ struct device_node *of_find_node_by_phandle(phandle handle)
1329 for (np = allnodes; np != 0; np = np->allnext) 1326 for (np = allnodes; np != 0; np = np->allnext)
1330 if (np->linux_phandle == handle) 1327 if (np->linux_phandle == handle)
1331 break; 1328 break;
1332 if (np) 1329 of_node_get(np);
1333 of_node_get(np);
1334 read_unlock(&devtree_lock); 1330 read_unlock(&devtree_lock);
1335 return np; 1331 return np;
1336} 1332}
@@ -1353,8 +1349,7 @@ struct device_node *of_find_all_nodes(struct device_node *prev)
1353 for (; np != 0; np = np->allnext) 1349 for (; np != 0; np = np->allnext)
1354 if (of_node_get(np)) 1350 if (of_node_get(np))
1355 break; 1351 break;
1356 if (prev) 1352 of_node_put(prev);
1357 of_node_put(prev);
1358 read_unlock(&devtree_lock); 1353 read_unlock(&devtree_lock);
1359 return np; 1354 return np;
1360} 1355}
@@ -1399,8 +1394,7 @@ struct device_node *of_get_next_child(const struct device_node *node,
1399 for (; next != 0; next = next->sibling) 1394 for (; next != 0; next = next->sibling)
1400 if (of_node_get(next)) 1395 if (of_node_get(next))
1401 break; 1396 break;
1402 if (prev) 1397 of_node_put(prev);
1403 of_node_put(prev);
1404 read_unlock(&devtree_lock); 1398 read_unlock(&devtree_lock);
1405 return next; 1399 return next;
1406} 1400}