Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 123099
b: refs/heads/master
c: 7736a3d
h: refs/heads/master
i:
  123097: c127897
  123095: c0a36fc
v: v3
  • Loading branch information
Anton Vorontsov authored and Paul Mackerras committed Dec 21, 2008
1 parent 20b7da3 commit 3a9a0b9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c1bb7c6d04ebdf48998649100c5267a9139debf5
refs/heads/master: 7736a3db98bed028d0e5235f8958a730acfd822e
22 changes: 16 additions & 6 deletions trunk/drivers/of/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,8 @@ EXPORT_SYMBOL_GPL(of_modalias_node);
* @list_name: property name that contains a list
* @cells_name: property name that specifies phandles' arguments count
* @index: index of a phandle to parse out
* @out_node: pointer to device_node struct pointer (will be filled)
* @out_args: pointer to arguments pointer (will be filled)
* @out_node: optional pointer to device_node struct pointer (will be filled)
* @out_args: optional pointer to arguments pointer (will be filled)
*
* This function is useful to parse lists of phandles and their arguments.
* Returns 0 on success and fills out_node and out_args, on error returns
Expand Down Expand Up @@ -534,7 +534,7 @@ int of_parse_phandles_with_args(struct device_node *np, const char *list_name,
int size;
int cur_index = 0;
struct device_node *node = NULL;
const void *args;
const void *args = NULL;

list = of_get_property(np, list_name, &size);
if (!list) {
Expand Down Expand Up @@ -580,16 +580,26 @@ int of_parse_phandles_with_args(struct device_node *np, const char *list_name,

of_node_put(node);
node = NULL;
args = NULL;
cur_index++;
}

if (!node) {
ret = -ENOENT;
/*
* args w/o node indicates that the loop above has stopped at
* the 'hole' cell. Report this differently.
*/
if (args)
ret = -EEXIST;
else
ret = -ENOENT;
goto err0;
}

*out_node = node;
*out_args = args;
if (out_node)
*out_node = node;
if (out_args)
*out_args = args;

return 0;
err1:
Expand Down

0 comments on commit 3a9a0b9

Please sign in to comment.