summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/cpu/armv8/fsl-layerscape/fdt.c9
-rw-r--r--arch/arm/cpu/armv8/fsl-layerscape/icid.c5
-rw-r--r--arch/arm/mach-tegra/gpu.c5
-rw-r--r--arch/mips/mach-octeon/octeon_fdt.c11
-rw-r--r--arch/powerpc/cpu/mpc85xx/liodn.c9
5 files changed, 8 insertions, 31 deletions
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
index 4354aa251e1..2fa7ebf1639 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
@@ -161,14 +161,9 @@ void fsl_fdt_disable_usb(void *blob)
* controller is used, SYSCLK must meet the additional requirement
* of 100 MHz.
*/
- if (get_board_sys_clk() != 100000000) {
- off = fdt_node_offset_by_compatible(blob, -1, "snps,dwc3");
- while (off != -FDT_ERR_NOTFOUND) {
+ if (get_board_sys_clk() != 100000000)
+ fdt_for_each_node_by_compatible(off, blob, -1, "snps,dwc3")
fdt_status_disabled(blob, off);
- off = fdt_node_offset_by_compatible(blob, off,
- "snps,dwc3");
- }
- }
}
#ifdef CONFIG_HAS_FEATURE_GIC64K_ALIGN
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/icid.c b/arch/arm/cpu/armv8/fsl-layerscape/icid.c
index 82c5a8b123a..25cd82f16eb 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/icid.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/icid.c
@@ -116,8 +116,7 @@ void fdt_fixup_fman_port_icid_by_compat(void *blob, int smmu_ph,
int noff, len, icid;
const u32 *prop;
- noff = fdt_node_offset_by_compatible(blob, -1, compat);
- while (noff > 0) {
+ fdt_for_each_node_by_compatible(noff, blob, -1, compat) {
prop = fdt_getprop(blob, noff, "cell-index", &len);
if (!prop) {
printf("WARNING missing cell-index for fman port\n");
@@ -137,8 +136,6 @@ void fdt_fixup_fman_port_icid_by_compat(void *blob, int smmu_ph,
}
fdt_set_iommu_prop(blob, noff, smmu_ph, (u32 *)&icid, 1);
-
- noff = fdt_node_offset_by_compatible(blob, noff, compat);
}
}
diff --git a/arch/arm/mach-tegra/gpu.c b/arch/arm/mach-tegra/gpu.c
index 13ffade0408..36538e7f96a 100644
--- a/arch/arm/mach-tegra/gpu.c
+++ b/arch/arm/mach-tegra/gpu.c
@@ -46,11 +46,8 @@ int tegra_gpu_enable_node(void *blob, const char *compat)
if (!_configured)
return 0;
- offset = fdt_node_offset_by_compatible(blob, -1, compat);
- while (offset != -FDT_ERR_NOTFOUND) {
+ fdt_for_each_node_by_compatible(offset, blob, -1, compat)
fdt_status_okay(blob, offset);
- offset = fdt_node_offset_by_compatible(blob, offset, compat);
- }
return 0;
}
diff --git a/arch/mips/mach-octeon/octeon_fdt.c b/arch/mips/mach-octeon/octeon_fdt.c
index 199f6925166..5c5a14e87af 100644
--- a/arch/mips/mach-octeon/octeon_fdt.c
+++ b/arch/mips/mach-octeon/octeon_fdt.c
@@ -424,12 +424,8 @@ void __octeon_fixup_fdt_mac_addr(void)
}
/* Assign 78XX addresses in the order they appear in the device tree. */
- node = fdt_node_offset_by_compatible(working_fdt, -1, "cavium,octeon-7890-bgx-port");
- while (node != -FDT_ERR_NOTFOUND) {
+ fdt_for_each_node_by_compatible(node, working_fdt, -1, "cavium,octeon-7890-bgx-port")
octeon_set_one_fdt_mac(node, &mac);
- node = fdt_node_offset_by_compatible(working_fdt, node,
- "cavium,octeon-7890-bgx-port");
- }
}
#endif
@@ -450,11 +446,8 @@ void __octeon_fixup_fdt_uart(void)
/* Device trees already have good values for fast simulator
* output, real boards need the correct value.
*/
- node = fdt_node_offset_by_compatible(working_fdt, -1, "cavium,octeon-3860-uart");
- while (node != -FDT_ERR_NOTFOUND) {
+ fdt_for_each_node_by_compatible(node, working_fdt, -1, "cavium,octeon-3860-uart")
fdt_setprop_inplace_cell(working_fdt, node, "clock-frequency", clk);
- node = fdt_node_offset_by_compatible(working_fdt, node, "cavium,octeon-3860-uart");
- }
}
/**
diff --git a/arch/powerpc/cpu/mpc85xx/liodn.c b/arch/powerpc/cpu/mpc85xx/liodn.c
index e552378e78b..a0840024949 100644
--- a/arch/powerpc/cpu/mpc85xx/liodn.c
+++ b/arch/powerpc/cpu/mpc85xx/liodn.c
@@ -268,15 +268,10 @@ static void fdt_fixup_pci_liodn_offsets(void *fdt, const char *compat,
* Count the number of pci nodes.
* It's needed later when the interleaved liodn offsets are generated.
*/
- off = fdt_node_offset_by_compatible(fdt, -1, compat);
- while (off != -FDT_ERR_NOTFOUND) {
+ fdt_for_each_node_by_compatible(off, fdt, -1, compat)
pci_cnt++;
- off = fdt_node_offset_by_compatible(fdt, off, compat);
- }
- for (off = fdt_node_offset_by_compatible(fdt, -1, compat);
- off != -FDT_ERR_NOTFOUND;
- off = fdt_node_offset_by_compatible(fdt, off, compat)) {
+ fdt_for_each_node_by_compatible(off, fdt, -1, compat) {
base_liodn = fdt_getprop(fdt, off, "fsl,liodn", &rc);
if (!base_liodn) {
char path[64];