mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-05 15:15:44 +00:00
bsps/shared/ofw: Make rtems_ofw_get_effective_phandle iterative
Refactored recursive rtems_ofw_get_effective_phandle into a iterative function.
This commit is contained in:
committed by
Christian Mauderer
parent
066687c43a
commit
6da50db55b
@@ -509,11 +509,12 @@ static phandle_t rtems_ofw_get_effective_phandle(
|
|||||||
{
|
{
|
||||||
phandle_t child;
|
phandle_t child;
|
||||||
phandle_t ref;
|
phandle_t ref;
|
||||||
|
int node_offset;
|
||||||
|
|
||||||
for (child = rtems_ofw_child(node); child != 0; child = rtems_ofw_peer(child)) {
|
node_offset = fdt_path_offset(fdtp, "/");
|
||||||
ref = rtems_ofw_get_effective_phandle(child, xref);
|
|
||||||
if (ref != -1)
|
while ((node_offset = fdt_next_node(fdtp, node_offset, NULL)) > 0) {
|
||||||
return ref;
|
child = rtems_fdt_offset_to_phandle(node_offset);
|
||||||
|
|
||||||
if (rtems_ofw_get_enc_prop(child, "phandle", &ref, sizeof(ref)) == -1 &&
|
if (rtems_ofw_get_enc_prop(child, "phandle", &ref, sizeof(ref)) == -1 &&
|
||||||
rtems_ofw_get_enc_prop(child, "ibm,phandle", &ref, sizeof(ref)) == -1 &&
|
rtems_ofw_get_enc_prop(child, "ibm,phandle", &ref, sizeof(ref)) == -1 &&
|
||||||
|
|||||||
Reference in New Issue
Block a user