fdtdec: only create phandle if caller wants it in fdtdec_add_reserved_memory()
authorHeiko Stuebner <heiko.stuebner@theobroma-systems.com>
Wed, 23 Oct 2019 14:46:39 +0000 (16:46 +0200)
committerSimon Glass <sjg@chromium.org>
Thu, 14 Nov 2019 13:09:34 +0000 (07:09 -0600)
commit357d2ceba0354e29462ac25924f5e42623c22b5b
treef03173ccfa5d3db2b6bb0d738590a9e37467fd39
parent086336a22508affb7567bf6d383642554eda5a56
fdtdec: only create phandle if caller wants it in fdtdec_add_reserved_memory()

The phandlep pointer returning the phandle to the caller is optional
and if it is not set when calling fdtdec_add_reserved_memory() it is
highly likely that the caller is not interested in a phandle to the
created reserved-memory area and really just wants that area added.

So just don't create a phandle in that case.

Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
include/fdtdec.h
lib/fdtdec.c