diff options
Diffstat (limited to 'arch/powerpc/kernel/prom.c')
-rw-r--r-- | arch/powerpc/kernel/prom.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 1fc732a552db..3e86e6e0f778 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
@@ -991,7 +991,7 @@ void __init early_init_devtree(void *params) | |||
991 | of_scan_flat_dt(early_init_dt_scan_memory, NULL); | 991 | of_scan_flat_dt(early_init_dt_scan_memory, NULL); |
992 | 992 | ||
993 | /* Save command line for /proc/cmdline and then parse parameters */ | 993 | /* Save command line for /proc/cmdline and then parse parameters */ |
994 | strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE); | 994 | strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE); |
995 | parse_early_param(); | 995 | parse_early_param(); |
996 | 996 | ||
997 | /* Reserve LMB regions used by kernel, initrd, dt, etc... */ | 997 | /* Reserve LMB regions used by kernel, initrd, dt, etc... */ |
@@ -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 | } |