On 4 May 2018 at 19:37, Jonathan Marler <johnnymar...@gmail.com> wrote: > Signed-off-by: Jonathan Marler <johnnymar...@gmail.com>
Hi; thanks for this patch. > --- > device_tree.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/device_tree.c b/device_tree.c > index 52c3358..2b75905 100644 > --- a/device_tree.c > +++ b/device_tree.c > @@ -379,8 +379,12 @@ uint32_t qemu_fdt_get_phandle(void *fdt, const char > *path) > > r = fdt_get_phandle(fdt, findnode_nofail(fdt, path)); > if (r == 0) { > - error_report("%s: Couldn't get phandle for %s: %s", __func__, > - path, fdt_strerror(r)); > + error_report("%s: Node %s does not have a 'phandle'", __func__, > + path); > + exit(1); > + } > + if (r == -1) { > + error_report("%s: Couldn't get phandle for %s", __func__, path); > exit(1); > } Could you explain in what situation this is needed? The documentation for fdt_get_phandle() says * returns: * the phandle of the node at nodeoffset, on success (!= 0, != -1) * 0, if the node has no phandle, or another error occurs which I interpret to mean that it is not possible for it to return -1. thanks -- PMM