From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Fri, 19 May 2017 20:29:03 -0600 Subject: [U-Boot] [PATCH v2 8/9] dm: core: Add ofnode to represent device tree nodes In-Reply-To: References: <20170501151852.26670-1-sjg@chromium.org> <20170501151852.26670-9-sjg@chromium.org> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Masahiro, On 16 May 2017 at 04:35, Masahiro Yamada wrote: > > Hi Simon, > > > 2017-05-02 0:18 GMT+09:00 Simon Glass : > > With live tree we need a struct device_node * to reference a node. With > > the existing flat tree, we need an int offset. We need to unify these into > > a single value which can represent both. > > > > Add an ofnode union for this and adjust existing code to move to this. > > > > Signed-off-by: Simon Glass > > --- > > > > Changes in v2: None > > > > drivers/core/device.c | 2 +- > > drivers/core/root.c | 2 +- > > include/dm.h | 1 + > > include/dm/device.h | 14 +++++-- > > include/dm/ofnode.h | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++ > > 5 files changed, 113 insertions(+), 6 deletions(-) > > create mode 100644 include/dm/ofnode.h > When you add a new header, please make sure it is self-contained. > > You use bool for offset_toofnode() and ofnode_equal(). > So you need to include from this header. > > (or, use "int" for the return type.) I'm wondering about this problem: In general we want to minimise the size of headers included by U-Boot. For something like ofnode which is used by several header files we end up including it many times, once per header. With dm.h we avoid this since the header is only included ones (and in the correct order). What is the best solution to this? Regards, Simon