diff options
author | G S Niteesh Babu <niteesh.gs@gmail.com> | 2021-02-06 23:10:12 +0530 |
---|---|---|
committer | Christian Mauderer <oss@c-mauderer.de> | 2021-02-08 21:08:36 +0100 |
commit | 8b32f1d8c46f65ee8dea396d11df4117ca061e11 (patch) | |
tree | 40c81115392dbd286d6b37195702df54b3338045 /bsps | |
parent | bsps/shared/ofw: Make rtems_ofw_get_effective_phandle iterative (diff) | |
download | rtems-8b32f1d8c46f65ee8dea396d11df4117ca061e11.tar.bz2 |
bsps/shared/ofw: Bug fixes
Fixed bugs in rtems_ofw_get_prop, rtems_ofw_get_prop_len
and removed hardcoded value.
Diffstat (limited to 'bsps')
-rw-r--r-- | bsps/shared/ofw/ofw.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bsps/shared/ofw/ofw.c b/bsps/shared/ofw/ofw.c index 78576ecf45..1c3a81785d 100644 --- a/bsps/shared/ofw/ofw.c +++ b/bsps/shared/ofw/ofw.c @@ -162,7 +162,7 @@ ssize_t rtems_ofw_get_prop_len( return len + 1; } - if (prop == NULL && strcmp(propname, "/chosen") == 0) { + if (prop == NULL && offset == fdt_path_offset(fdtp, "/chosen")) { if (strcmp(propname, "fdtbootcpu") == 0) return sizeof(pcell_t); if (strcmp(propname, "fdtmemreserv") == 0) @@ -210,7 +210,7 @@ ssize_t rtems_ofw_get_prop( return len + 1; } - if (prop == NULL && strcmp(propname, "/chosen") == 0) { + if (prop == NULL && offset == fdt_path_offset(fdtp, "/chosen")) { if (strcmp(propname, "fdtbootcpu") == 0) { cpuid = cpu_to_fdt32(fdt_boot_cpuid_phys(fdtp)); len = sizeof(cpuid); @@ -240,7 +240,7 @@ ssize_t rtems_ofw_get_enc_prop( { ssize_t rv; - assert(len % 4 == 0); + assert(len % sizeof(pcell_t) == 0); rv = rtems_ofw_get_prop(node, prop, buf, len); if (rv < 0) { |