config->name = fdt_get_name(fdt, node, NULL);
- fdt_for_each_subnode(fdt, subnode, node) {
+ fdt_for_each_subnode(subnode, fdt, node) {
struct tegra_xusb_padctl_group *group;
int err;
return err;
}
- fdt_for_each_subnode(fdt, subnode, node) {
+ fdt_for_each_subnode(subnode, fdt, node) {
struct tegra_xusb_padctl_config *config = &padctl->config;
err = tegra_xusb_padctl_config_parse_dt(padctl, config, fdt,
}
/* Process all hash subnodes of the component image node */
- fdt_for_each_subnode(fit, noffset, image_noffset) {
+ fdt_for_each_subnode(noffset, fit, image_noffset) {
const char *name = fit_get_name(fit, noffset, NULL);
/*
int ret;
/* Process all hash subnodes of the component image node */
- fdt_for_each_subnode(fit, noffset, image_noffset) {
+ fdt_for_each_subnode(noffset, fit, image_noffset) {
const char *name = fit_get_name(fit, noffset, NULL);
if (!strncmp(name, FIT_SIG_NODENAME,
return 0;
}
- fdt_for_each_subnode(sig_blob, noffset, sig_node) {
+ fdt_for_each_subnode(noffset, sig_blob, sig_node) {
const char *required;
int ret;
int ret;
/* Process all hash subnodes of the component conf node */
- fdt_for_each_subnode(fit, noffset, conf_noffset) {
+ fdt_for_each_subnode(noffset, fit, conf_noffset) {
const char *name = fit_get_name(fit, noffset, NULL);
if (!strncmp(name, FIT_SIG_NODENAME,
return 0;
}
- fdt_for_each_subnode(sig_blob, noffset, sig_node) {
+ fdt_for_each_subnode(noffset, sig_blob, sig_node) {
const char *required;
int ret;
active_slave = fdtdec_get_int(fdt, node, "active_slave", 0);
priv->data.active_slave = active_slave;
- fdt_for_each_subnode(fdt, subnode, node) {
+ fdt_for_each_subnode(subnode, fdt, node) {
int len;
const char *name;
char *slave_name;
interfaces = fdt_subnode_offset(fdt, gbe, "interfaces");
- fdt_for_each_subnode(fdt, slave, interfaces) {
+ fdt_for_each_subnode(slave, fdt, interfaces) {
int slave_no;
slave_no = fdtdec_get_int(fdt, slave, "slave-port", -ENOENT);
}
sec_slave = fdt_subnode_offset(fdt, gbe, "secondary-slave-ports");
- fdt_for_each_subnode(fdt, slave, sec_slave) {
+ fdt_for_each_subnode(slave, fdt, sec_slave) {
int slave_no;
slave_no = fdtdec_get_int(fdt, slave, "slave-port", -ENOENT);
return -ENOENT;
}
- fdt_for_each_subnode(blob, subnode, node) {
+ fdt_for_each_subnode(subnode, blob, node) {
/* Skip disabled ports */
if (!fdtdec_get_is_enabled(blob, subnode))
continue;
}
#endif
- fdt_for_each_subnode(fdt, subnode, node) {
+ fdt_for_each_subnode(subnode, fdt, node) {
unsigned int index = 0, num_lanes = 0;
struct tegra_pcie_port *port;
}
lane = 0;
- fdt_for_each_subnode(blob, subnode, node) {
+ fdt_for_each_subnode(subnode, blob, node) {
/* Skip disabled ports */
if (!fdtdec_get_is_enabled(blob, subnode))
continue;
return -EINVAL;
}
- fdt_for_each_subnode(gd->fdt_blob, node, dev->of_offset) {
+ fdt_for_each_subnode(node, gd->fdt_blob, dev->of_offset) {
if (fdt_getprop(gd->fdt_blob, node, "gpio-controller", &len)) {
gpio = node;
break;
int node = dev->of_offset;
int subnode, len;
- fdt_for_each_subnode(blob, subnode, node) {
+ fdt_for_each_subnode(subnode, blob, node) {
const char *name;
char *temp;
}
/* Count flash numbers */
- fdt_for_each_subnode(blob, subnode, node)
+ fdt_for_each_subnode(subnode, blob, node)
++flash_num;
if (flash_num == 0) {
/**
* fdt_for_each_subnode - iterate over all subnodes of a parent
*
+ * @node: child node (int, lvalue)
+ * @fdt: FDT blob (const void *)
+ * @parent: parent node (int)
+ *
* This is actually a wrapper around a for loop and would be used like so:
*
- * fdt_for_each_subnode(fdt, node, parent) {
- * ...
- * use node
+ * fdt_for_each_subnode(node, fdt, parent) {
+ * Use node
* ...
* }
*
- * Note that this is implemented as a macro and node is used as iterator in
- * the loop. It should therefore be a locally allocated variable. The parent
- * variable on the other hand is never modified, so it can be constant or
- * even a literal.
+ * if ((node < 0) && (node != -FDT_ERR_NOT_FOUND)) {
+ * Error handling
+ * }
+ *
+ * Note that this is implemented as a macro and @node is used as
+ * iterator in the loop. The parent variable be constant or even a
+ * literal.
*
- * @fdt: FDT blob (const void *)
- * @node: child node (int)
- * @parent: parent node (int)
*/
-#define fdt_for_each_subnode(fdt, node, parent) \
+#define fdt_for_each_subnode(node, fdt, parent) \
for (node = fdt_first_subnode(fdt, parent); \
node >= 0; \
node = fdt_next_subnode(fdt, node))
int subnode;
int num = 0;
- fdt_for_each_subnode(blob, subnode, node)
+ fdt_for_each_subnode(subnode, blob, node)
num++;
return num;
if (!found && !ret)
return ret;
- fdt_for_each_subnode(fdto, child, node)
+ fdt_for_each_subnode(child, fdto, node)
overlay_adjust_node_phandles(fdto, child, delta);
return 0;
}
}
- fdt_for_each_subnode(fdto, fixup_child, fixup_node) {
+ fdt_for_each_subnode(fixup_child, fdto, fixup_node) {
const char *fixup_child_name = fdt_get_name(fdto, fixup_child,
NULL);
int tree_child;
return ret;
}
- fdt_for_each_subnode(fdto, node, fragment) {
+ fdt_for_each_subnode(node, fdto, fragment) {
const char *name = fdt_get_name(fdto, node, NULL);
int nnode;
int ret;
{
int fragment;
- fdt_for_each_subnode(dto, fragment, 0) {
+ fdt_for_each_subnode(fragment, dto, 0) {
int overlay;
int target;
int ret;