summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/sbi_utils/fdt/fdt_helper.h3
-rw-r--r--lib/utils/fdt/fdt_helper.c5
-rw-r--r--lib/utils/ipi/fdt_ipi.c2
-rw-r--r--lib/utils/irqchip/fdt_irqchip.c2
-rw-r--r--lib/utils/reset/fdt_reset.c2
-rw-r--r--lib/utils/serial/fdt_serial.c2
-rw-r--r--lib/utils/timer/fdt_timer.c2
-rw-r--r--platform/generic/platform.c2
8 files changed, 11 insertions, 9 deletions
diff --git a/include/sbi_utils/fdt/fdt_helper.h b/include/sbi_utils/fdt/fdt_helper.h
index 42390e8..72fb167 100644
--- a/include/sbi_utils/fdt/fdt_helper.h
+++ b/include/sbi_utils/fdt/fdt_helper.h
@@ -28,7 +28,8 @@ struct platform_uart_data {
const struct fdt_match *fdt_match_node(void *fdt, int nodeoff,
const struct fdt_match *match_table);
-int fdt_find_match(void *fdt, const struct fdt_match *match_table,
+int fdt_find_match(void *fdt, int startoff,
+ const struct fdt_match *match_table,
const struct fdt_match **out_match);
int fdt_get_node_addr_size(void *fdt, int node, unsigned long *addr,
diff --git a/lib/utils/fdt/fdt_helper.c b/lib/utils/fdt/fdt_helper.c
index 61d70d9..58f8951 100644
--- a/lib/utils/fdt/fdt_helper.c
+++ b/lib/utils/fdt/fdt_helper.c
@@ -43,7 +43,8 @@ const struct fdt_match *fdt_match_node(void *fdt, int nodeoff,
return NULL;
}
-int fdt_find_match(void *fdt, const struct fdt_match *match_table,
+int fdt_find_match(void *fdt, int startoff,
+ const struct fdt_match *match_table,
const struct fdt_match **out_match)
{
int nodeoff;
@@ -52,7 +53,7 @@ int fdt_find_match(void *fdt, const struct fdt_match *match_table,
return SBI_ENODEV;
while (match_table->compatible) {
- nodeoff = fdt_node_offset_by_compatible(fdt, -1,
+ nodeoff = fdt_node_offset_by_compatible(fdt, startoff,
match_table->compatible);
if (nodeoff >= 0) {
if (out_match)
diff --git a/lib/utils/ipi/fdt_ipi.c b/lib/utils/ipi/fdt_ipi.c
index d8ba0b2..d99a941 100644
--- a/lib/utils/ipi/fdt_ipi.c
+++ b/lib/utils/ipi/fdt_ipi.c
@@ -69,7 +69,7 @@ static int fdt_ipi_cold_init(void)
for (pos = 0; pos < array_size(ipi_drivers); pos++) {
drv = ipi_drivers[pos];
- noff = fdt_find_match(fdt, drv->match_table, &match);
+ noff = fdt_find_match(fdt, -1, drv->match_table, &match);
if (noff < 0)
continue;
diff --git a/lib/utils/irqchip/fdt_irqchip.c b/lib/utils/irqchip/fdt_irqchip.c
index 5f5cf97..87def52 100644
--- a/lib/utils/irqchip/fdt_irqchip.c
+++ b/lib/utils/irqchip/fdt_irqchip.c
@@ -42,7 +42,7 @@ static int fdt_irqchip_cold_init(void)
for (pos = 0; pos < array_size(irqchip_drivers); pos++) {
drv = irqchip_drivers[pos];
- noff = fdt_find_match(fdt, drv->match_table, &match);
+ noff = fdt_find_match(fdt, -1, drv->match_table, &match);
if (noff < 0)
continue;
diff --git a/lib/utils/reset/fdt_reset.c b/lib/utils/reset/fdt_reset.c
index 98fbb54..dfbd33e 100644
--- a/lib/utils/reset/fdt_reset.c
+++ b/lib/utils/reset/fdt_reset.c
@@ -38,7 +38,7 @@ int fdt_reset_init(void)
for (pos = 0; pos < array_size(reset_drivers); pos++) {
drv = reset_drivers[pos];
- noff = fdt_find_match(fdt, drv->match_table, &match);
+ noff = fdt_find_match(fdt, -1, drv->match_table, &match);
if (noff < 0)
continue;
diff --git a/lib/utils/serial/fdt_serial.c b/lib/utils/serial/fdt_serial.c
index ae1aeea..fa6c478 100644
--- a/lib/utils/serial/fdt_serial.c
+++ b/lib/utils/serial/fdt_serial.c
@@ -91,7 +91,7 @@ int fdt_serial_init(void)
for (pos = 0; pos < array_size(serial_drivers); pos++) {
drv = serial_drivers[pos];
- noff = fdt_find_match(fdt, drv->match_table, &match);
+ noff = fdt_find_match(fdt, -1, drv->match_table, &match);
if (noff < 0)
continue;
diff --git a/lib/utils/timer/fdt_timer.c b/lib/utils/timer/fdt_timer.c
index 1ad08fe..46edb83 100644
--- a/lib/utils/timer/fdt_timer.c
+++ b/lib/utils/timer/fdt_timer.c
@@ -80,7 +80,7 @@ static int fdt_timer_cold_init(void)
for (pos = 0; pos < array_size(timer_drivers); pos++) {
drv = timer_drivers[pos];
- noff = fdt_find_match(fdt, drv->match_table, &match);
+ noff = fdt_find_match(fdt, -1, drv->match_table, &match);
if (noff < 0)
continue;
diff --git a/platform/generic/platform.c b/platform/generic/platform.c
index 7b4a0ae..a4a07e3 100644
--- a/platform/generic/platform.c
+++ b/platform/generic/platform.c
@@ -41,7 +41,7 @@ static void fw_platform_lookup_special(void *fdt, int root_offset)
if (!plat->match_table)
continue;
- noff = fdt_find_match(fdt, plat->match_table, &match);
+ noff = fdt_find_match(fdt, -1, plat->match_table, &match);
if (noff < 0)
continue;