*/
if ( param_acpi_off || ( !param_acpi_force
&& device_tree_for_each_node(device_tree_flattened,
- dt_scan_depth1_nodes, NULL)))
+ 0, 0, dt_scan_depth1_nodes, NULL)))
goto disable;
/*
/**
* device_tree_for_each_node - iterate over all device tree nodes
* @fdt: flat device tree.
+ * @node: node to start the search from
+ * @depth: min depth of the search
* @func: function to call for each node.
* @data: data to pass to @func.
*
* returns a value different from 0, that value is returned immediately.
*/
int __init device_tree_for_each_node(const void *fdt,
+ int node, int depth,
device_tree_node_func func,
void *data)
{
- int node;
- int depth;
u32 address_cells[DEVICE_TREE_MAX_DEPTH];
u32 size_cells[DEVICE_TREE_MAX_DEPTH];
- int ret;
+ int ret, min_depth = depth;
- for ( node = 0, depth = 0;
- node >=0 && depth >= 0;
+ for ( ; node >=0 && depth >= min_depth;
node = fdt_next_node(fdt, node, &depth) )
{
const char *name = fdt_get_name(fdt, node, NULL);
add_boot_module(BOOTMOD_FDT, paddr, fdt_totalsize(fdt), false);
- device_tree_for_each_node((void *)fdt, early_scan_node, NULL);
+ device_tree_for_each_node((void *)fdt, 0, 0, early_scan_node, NULL);
early_print_info();
return fdt_totalsize(fdt);
extern const void *device_tree_flattened;
int device_tree_for_each_node(const void *fdt,
- device_tree_node_func func,
- void *data);
+ int node, int depth,
+ device_tree_node_func func,
+ void *data);
/**
* dt_unflatten_host_device_tree - Unflatten the host device tree