mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-28 15:41:40 +00:00
fdtdec: correct test on return of fdt_node_offset_by_phandle
The result of fdt_node_offset_by_phandle is negative for error, so this patch corrects the check of this result in fdtdec_parse_phandle_with_args. This patch allows to have the same behavior with or without OF_LIVE for the function dev_read_phandle_with_args with cell_name = NULL and with invalid phandle. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
89f68302ca
commit
cba487c7fc
1 changed files with 1 additions and 1 deletions
|
@ -746,7 +746,7 @@ int fdtdec_parse_phandle_with_args(const void *blob, int src_node,
|
|||
if (cells_name || cur_index == index) {
|
||||
node = fdt_node_offset_by_phandle(blob,
|
||||
phandle);
|
||||
if (!node) {
|
||||
if (node < 0) {
|
||||
debug("%s: could not find phandle\n",
|
||||
fdt_get_name(blob, src_node,
|
||||
NULL));
|
||||
|
|
Loading…
Reference in a new issue