diff options
author | Simon Glass <sjg@chromium.org> | 2015-03-05 12:25:19 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-04-16 19:27:42 -0600 |
commit | 106cce9604306743c86addd4d27426cce498c9d1 (patch) | |
tree | d59865db3298a477d4dab6175d5c8c5a215de46d /lib | |
parent | cc5e196e0350055e3e438d5dc2341316027c8d93 (diff) | |
download | u-boot-imx-106cce9604306743c86addd4d27426cce498c9d1.zip u-boot-imx-106cce9604306743c86addd4d27426cce498c9d1.tar.gz u-boot-imx-106cce9604306743c86addd4d27426cce498c9d1.tar.bz2 |
fdt: Tighten up error handling in fdtdec_get_pci_addr()
This function returns -ENOENT when the property is missing (which the caller
might forgive) and also when the property is present but incorrectly
formatted (which many callers would like to report).
Update the error return value to allow these different situations to be
distinguished.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/fdtdec.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/fdtdec.c b/lib/fdtdec.c index 915fe24..fa7da89 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -160,8 +160,10 @@ int fdtdec_get_pci_addr(const void *blob, int node, enum fdt_pci_space type, } } - if (i == num) + if (i == num) { + ret = -ENXIO; goto fail; + } return 0; } else { |