From: Ian Campbell Subject: Re: [PATCH V1 16/29] xen/arm: Build DOM0 FDT by browsing the device tree structure Date: Mon, 9 Sep 2013 13:39:55 +0100 Message-ID: <1378730395.19967.110.camel@kazak.uk.xensource.com> References: <1377701263-3319-1-git-send-email-julien.grall@linaro.org> <1377701263-3319-17-git-send-email-julien.grall@linaro.org> <1378726404.19967.67.camel@kazak.uk.xensource.com> <522DBE86.4070607@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <522DBE86.4070607@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: stefano.stabellini@eu.citrix.com, andre.przywara@linaro.org, patches@linaro.org, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Mon, 2013-09-09 at 13:26 +0100, Julien Grall wrote: > On 09/09/2013 12:33 PM, Ian Campbell wrote: > > On Wed, 2013-08-28 at 15:47 +0100, Julien Grall wrote: > >> if ( early_info.modules.nr_mods >= MOD_KERNEL && > >> early_info.modules.module[MOD_KERNEL].cmdline[0] ) > >> bootargs = &early_info.modules.module[MOD_KERNEL].cmdline[0]; > >> > >> - for ( prop = fdt_first_property_offset(fdt, node); > >> - prop >= 0; > >> - prop = fdt_next_property_offset(fdt, prop) ) > >> + for_each_property_of_node (np, pp) > > > > Is "of" here as in "the property of the node" or is it a stray Open > > Firmware from the Linux naming of these functions? > > > > Perhaps a dt_ prefix to match all the others? > > Right. I will send a patch to rename for_each_property_of_node to > dt_for_each_property_of_node. Might dt_for_each_node_property fit better with the other functions? > > > > This comment is saying that the name of the name property used to be > > something else? What was it? Which version of FDT was that -- do we need > > to care? > > Right, on older FDT version (< 0x10) each node has 2 different name: > - the name just after FDT_BEGIN_NODE in the fdt which correspond to > the "filename". > - the name in property "name" which is a convenient name. > > So we can't use the name field in device tree to retrieve the name to > create the node. > > For the FDT version, I don't know if we need to care. Linux pays > attention to it in the device tree code. I'm not sure we need to care either, I expect we will never see <0x10 in our uses (they are probbaly burnt into the ROMs of PPC machines) but of it is easy enough to so we might as well I guess? The alternative would be an explicit check for versions we know we understand. Ian.