diff options
author | Renato Botelho <renato@netgate.com> | 2017-05-11 08:59:58 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-05-11 08:59:58 -0300 |
commit | 5fa580e9c45b6668f134701651fa17cad722750e (patch) | |
tree | 8c4a473887fb8b23533d37cf95c1a33a406d1fe8 /sys/boot/fdt | |
parent | 4a3427ce64e27e7bac30020eb566d3b6a9072d12 (diff) | |
parent | dad5ccf4808854af8f6af32ab4f15dca00dae42b (diff) | |
download | FreeBSD-src-5fa580e9c45b6668f134701651fa17cad722750e.zip FreeBSD-src-5fa580e9c45b6668f134701651fa17cad722750e.tar.gz |
Merge remote-tracking branch 'origin/stable/11' into devel-11
Diffstat (limited to 'sys/boot/fdt')
-rw-r--r-- | sys/boot/fdt/fdt_overlay.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/boot/fdt/fdt_overlay.c b/sys/boot/fdt/fdt_overlay.c index a19f06e..9f77e86 100644 --- a/sys/boot/fdt/fdt_overlay.c +++ b/sys/boot/fdt/fdt_overlay.c @@ -64,7 +64,7 @@ fdt_get_fixup_location(void *fdtp, const char *fixup) int prop_offset, o, proplen; void *result; - result = 0; + result = NULL; path = strdup(fixup); prop = strchr(path, ':'); @@ -358,21 +358,26 @@ static int fdt_overlay_do_local_fixups(void *main_fdtp, void *overlay_fdtp) { int overlay_local_fixups_o; - int len; + int len, rv; const char *fixups; uint32_t phandle_offset; overlay_local_fixups_o = fdt_path_offset(overlay_fdtp, "/__local_fixups__"); - if (overlay_local_fixups_o < 0) - return (-1); + if (overlay_local_fixups_o < 0) { + /* If not local fixups - do nothing */ + if (overlay_local_fixups_o == -FDT_ERR_NOTFOUND) + return (0); + return (overlay_local_fixups_o); + } phandle_offset = fdt_max_phandle(main_fdtp); fdt_increase_phandles(overlay_fdtp, phandle_offset); fixups = fdt_getprop_w(overlay_fdtp, overlay_local_fixups_o, "fixup", &len); if (fixups) { - if (fdt_do_local_fixup(overlay_fdtp, fixups, len, phandle_offset) < 0) - return (-1); + rv = fdt_do_local_fixup(overlay_fdtp, fixups, len, phandle_offset); + if (rv < 0) + return (rv); } return (0); |