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>
This commit is contained in:
Simon Glass
2015-03-05 12:25:19 -07:00
parent cc5e196e03
commit 106cce9604
2 changed files with 6 additions and 2 deletions

View File

@@ -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 {