summaryrefslogtreecommitdiffstats
path: root/include/fdtdec.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-03-05 12:25:19 -0700
committerSimon Glass <sjg@chromium.org>2015-04-16 19:27:42 -0600
commit106cce9604306743c86addd4d27426cce498c9d1 (patch)
treed59865db3298a477d4dab6175d5c8c5a215de46d /include/fdtdec.h
parentcc5e196e0350055e3e438d5dc2341316027c8d93 (diff)
downloadblackbird-obmc-uboot-106cce9604306743c86addd4d27426cce498c9d1.tar.gz
blackbird-obmc-uboot-106cce9604306743c86addd4d27426cce498c9d1.zip
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 'include/fdtdec.h')
-rw-r--r--include/fdtdec.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/fdtdec.h b/include/fdtdec.h
index 967fa88f9e..c39ad90f02 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -327,7 +327,9 @@ fdt_addr_t fdtdec_get_addr_size(const void *blob, int node,
* @param type pci address type (FDT_PCI_SPACE_xxx)
* @param prop_name name of property to find
* @param addr returns pci address in the form of fdt_pci_addr
- * @return 0 if ok, negative on error
+ * @return 0 if ok, -ENOENT if the property did not exist, -EINVAL if the
+ * format of the property was invalid, -ENXIO if the requested
+ * address type was not found
*/
int fdtdec_get_pci_addr(const void *blob, int node, enum fdt_pci_space type,
const char *prop_name, struct fdt_pci_addr *addr);
OpenPOWER on IntegriCloud