mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
of: Introduce of_for_each_phandle() helper macro
With this macro any user can easily iterate over a list of phandles. The patch also converts __of_parse_phandle_with_args() to make use of the macro. The of_count_phandle_with_args() function is not converted, because the macro hides the return value of of_phandle_iterator_init(), which is needed in there. Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Rob Herring <[email protected]>
This commit is contained in:
parent
2021bd01ff
commit
f623ce95a5
2 changed files with 7 additions and 6 deletions
|
|
@ -1543,13 +1543,8 @@ static int __of_parse_phandle_with_args(const struct device_node *np,
|
|||
struct of_phandle_iterator it;
|
||||
int rc, cur_index = 0;
|
||||
|
||||
rc = of_phandle_iterator_init(&it, np, list_name,
|
||||
cells_name, cell_count);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
/* Loop over the phandles until all the requested entry is found */
|
||||
while ((rc = of_phandle_iterator_next(&it)) == 0) {
|
||||
of_for_each_phandle(&it, rc, np, list_name, cells_name, cell_count) {
|
||||
/*
|
||||
* All of the error cases bail out of the loop, so at
|
||||
* this point, the parsing is successful. If the requested
|
||||
|
|
|
|||
Loading…
Reference in a new issue