u-boot/lib/libfdt
David Gibson 46743c412d libfdt: Correct fdt handling of overlays without fixups and base trees without symbols
The fdt_overlay_apply() function purports to support the edge cases where
an overlay has no fixups to be applied, or a base tree which has no
symbols (the latter can only work if the former is also true).  However it
gets it wrong in a couple of small ways:

  * In the no fixups case, it doesn't fail immediately, but will attempt
    fdt_for_each_property_offset() giving -FDT_ERR_NOTFOUND as the node
    offset, which will fail.  Instead it should succeed immediately, since
    there's nothing to do.
  * In the case of no symbols, it again doesn't fail immediately.  However
    if there is an actual fixup it will fail with an unexpected error,
    because -FDT_ERR_NOTFOUND is passed to fdt_getprop() when attempting to
    look up the symbols.  We should instead return -FDT_ERR_NOTFOUND
    directly.

Both of these errors lead to the code returning misleading error codes in
failing cases.

[ DTC commit: 7d8ef6e1db9794f72805a0855f4f7f12fadd03d3 ]

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>
2017-01-13 18:19:45 -07:00
..
fdt.c libfdt: Fix undefined behaviour in fdt_offset_ptr() 2016-10-13 13:54:10 -06:00
fdt_addresses.c lib/libfdt/: General aesthetic/style fixes. 2016-06-19 17:05:55 -06:00
fdt_empty_tree.c lib/libfdt/: General aesthetic/style fixes. 2016-06-19 17:05:55 -06:00
fdt_overlay.c libfdt: Correct fdt handling of overlays without fixups and base trees without symbols 2017-01-13 18:19:45 -07:00
fdt_region.c lib/libfdt/: General aesthetic/style fixes. 2016-06-19 17:05:55 -06:00
fdt_ro.c libfdt: fix fdt_stringlist_search() 2016-10-24 08:04:40 -04:00
fdt_rw.c libfdt: Sync up with upstream 2016-10-13 13:54:10 -06:00
fdt_strerror.c libfdt: Sync overlay with upstream 2016-10-23 12:08:48 -07:00
fdt_sw.c lib/libfdt/: General aesthetic/style fixes. 2016-06-19 17:05:55 -06:00
fdt_wip.c libfdt: Sync up with upstream 2016-10-13 13:54:10 -06:00
libfdt.swig dtoc: Support finding the offset of a property 2016-09-18 21:04:39 -06:00
libfdt_internal.h fdt: Sync up with libfdt 2014-08-09 11:17:04 -04:00
Makefile libfdt: Add overlay application function 2016-08-20 11:35:04 -04:00
README lib/libfdt/: General aesthetic/style fixes. 2016-06-19 17:05:55 -06:00
setup.py dm: Add a more efficient libfdt library 2016-07-14 20:40:24 -06:00
test_libfdt.py dm: Add a more efficient libfdt library 2016-07-14 20:40:24 -06:00

The libfdt functionality was written by David Gibson.  The original
source came from the Git repository:

URL:		git://ozlabs.org/home/dgibson/git/libfdt.git

author		David Gibson <dgibson@sneetch.(none)>
		Fri, 23 Mar 2007 04:16:54 +0000 (15:16 +1100)
committer	David Gibson <dgibson@sneetch.(none)>
		Fri, 23 Mar 2007 04:16:54 +0000 (15:16 +1100)
commit		857f54e79f74429af20c2b5ecc00ee98af6a3b8b
tree		2f648f0f88225a51ded452968d28b4402df8ade0
parent		07a12a08005f3b5cd9337900a6551e450c07b515

To adapt for U-Boot usage, only the applicable files were copied and
imported into the U-Boot Git repository.

Omitted:

  * GPL - U-Boot comes with a copy of the GPL license
  * test subdirectory - not directly useful for U-Boot

After importing, other customizations were performed.  See the
"git log" for details.

Jerry Van Baren