lib: utils/fdt: Fix DT property for APLIC delegation
authorAnup Patel <apatel@ventanamicro.com>
Wed, 5 Jun 2024 05:18:46 +0000 (10:48 +0530)
committerAnup Patel <anup@brainfault.org>
Wed, 5 Jun 2024 05:24:59 +0000 (10:54 +0530)
During Linux AIA driver review, the APLIC DT property for interrupt
delegation was renamed to "riscv,delegation" so let's use the new DT
property name and fallback to old DT property name if the new DT
property name is not available.

Fixes: 34612193af92 ("lib: utils/irqchip: Add FDT based driver for APLIC")
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
lib/utils/fdt/fdt_helper.c

index a0e93b92266687e2c09aff67506fd02b386505d2..9a945af4213e09e629f29d1fa19fbb8f811cce6c 100644 (file)
@@ -720,7 +720,9 @@ aplic_msi_parent_done:
                deleg->child_index = 0;
        }
 
-       del = fdt_getprop(fdt, nodeoff, "riscv,delegate", &len);
+       del = fdt_getprop(fdt, nodeoff, "riscv,delegation", &len);
+       if (!del)
+               del = fdt_getprop(fdt, nodeoff, "riscv,delegate", &len);
        if (!del || len < (3 * sizeof(fdt32_t)))
                goto skip_delegate_parse;
        d = 0;