mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-03-21 03:21:45 +00:00
lib: fdt_helper: Removed unnecessary dt parsing check
The check for the address being different from 0 for the UART, PLIC, APLIC and IMSIC dt nodes is unnnecessary and could skip valid nodes. Signed-off-by: Victoriano Morales <victoriano.morales@openchip.com> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/20260219083423.30690-1-victoriano.morales@openchip.com Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
committed by
Anup Patel
parent
2727c43f8d
commit
4dc1b9f7ba
@@ -502,7 +502,7 @@ static int fdt_parse_uart_node_common(const void *fdt, int nodeoffset,
|
||||
|
||||
rc = fdt_get_node_addr_size(fdt, nodeoffset, 0,
|
||||
®_addr, ®_size);
|
||||
if (rc < 0 || !reg_addr || !reg_size)
|
||||
if (rc < 0 || !reg_size)
|
||||
return SBI_ENODEV;
|
||||
uart->addr = reg_addr;
|
||||
|
||||
@@ -671,7 +671,7 @@ int fdt_parse_aplic_node(const void *fdt, int nodeoff, struct aplic_data *aplic)
|
||||
return SBI_ENODEV;
|
||||
|
||||
rc = fdt_get_node_addr_size(fdt, nodeoff, 0, ®_addr, ®_size);
|
||||
if (rc < 0 || !reg_addr || !reg_size)
|
||||
if (rc < 0 || !reg_size)
|
||||
return SBI_ENODEV;
|
||||
aplic->addr = reg_addr;
|
||||
aplic->size = reg_size;
|
||||
@@ -863,7 +863,7 @@ int fdt_parse_imsic_node(const void *fdt, int nodeoff, struct imsic_data *imsic)
|
||||
|
||||
rc = fdt_get_node_addr_size(fdt, nodeoff, i,
|
||||
®_addr, ®_size);
|
||||
if (rc < 0 || !reg_addr || !reg_size)
|
||||
if (rc < 0 || !reg_size)
|
||||
break;
|
||||
regs->addr = reg_addr;
|
||||
regs->size = reg_size;
|
||||
@@ -885,7 +885,7 @@ int fdt_parse_plic_node(const void *fdt, int nodeoffset, struct plic_data *plic)
|
||||
|
||||
rc = fdt_get_node_addr_size(fdt, nodeoffset, 0,
|
||||
®_addr, ®_size);
|
||||
if (rc < 0 || !reg_addr || !reg_size)
|
||||
if (rc < 0 || !reg_size)
|
||||
return SBI_ENODEV;
|
||||
plic->addr = reg_addr;
|
||||
plic->size = reg_size;
|
||||
|
||||
Reference in New Issue
Block a user