Skip to content

Commit

Permalink
devicetree/fdt: fix fdt_get_reg_size() get wrong size
Browse files Browse the repository at this point in the history
Signed-off-by: Bowen Wang <[email protected]>
Signed-off-by: ligd <[email protected]>
  • Loading branch information
CV-Bowen authored and GUIDINGLI committed Oct 8, 2024
1 parent 49c5dbe commit 802c8ae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/devicetree/fdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,9 @@ size_t fdt_get_reg_size(FAR const void *fdt, int offset)
reg = fdt_getprop(fdt, offset, "reg", NULL);
if (reg != NULL)
{
size = fdt_ld_by_cells(reg, fdt_get_parent_size_cells(fdt, offset));
size = fdt_ld_by_cells((FAR fdt32_t *)reg +
fdt_get_parent_address_cells(fdt, offset),
fdt_get_parent_size_cells(fdt, offset));
}

return size;
Expand Down

0 comments on commit 802c8ae

Please sign in to comment.