[PATCH 1/3] fdt.c: Add non-boottime device tree functions

Stephen Neuendorffer stephen.neuendorffer at xilinx.com
Thu Nov 18 08:41:56 EST 2010



> -----Original Message-----
> From: Grant Likely [mailto:glikely at secretlab.ca] On Behalf Of Grant
Likely
> Sent: Wednesday, November 17, 2010 12:00 PM
> To: Stephen Neuendorffer
> Cc: dirk.brandewie at gmail.com; devicetree-discuss at lists.ozlabs.org
> Subject: Re: [PATCH 1/3] fdt.c: Add non-boottime device tree functions
> 
> On Wed, Nov 17, 2010 at 11:46:07AM -0800, Stephen Neuendorffer wrote:
> >
> >
> > > -----Original Message-----
> > > From: Grant Likely [mailto:glikely at secretlab.ca] On Behalf Of
Grant
> > Likely
> > > Sent: Wednesday, November 17, 2010 11:42 AM
> > > To: Stephen Neuendorffer
> > > Cc: dirk.brandewie at gmail.com; devicetree-discuss at lists.ozlabs.org
> > > Subject: Re: [PATCH 1/3] fdt.c: Add non-boottime device tree
functions
> > >
> > > On Wed, Nov 17, 2010 at 11:15:43AM -0800, Stephen Neuendorffer
wrote:
> > > > In preparation for providing run-time handling of device trees,
> > factor
> > > > out some of the basic functions so that they take an arbitrary
blob,
> > > > rather than relying on the single boot-time tree.
> > > >
> > > > Signed-off-by: Stephen Neuendorffer
> > <stephen.neuendorffer at xilinx.com>
> > > > ---
> > > >  drivers/of/fdt.c       |  129
> > ++++++++++++++++++++++++++++++-----------------
> > > >  include/linux/of_fdt.h |    9 +++
> > > >  2 files changed, 91 insertions(+), 47 deletions(-)
> > > >
> > > > diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> > > > index c1360e0..6ae207a 100644
> > > > --- a/drivers/of/fdt.c
> > > > +++ b/drivers/of/fdt.c
> > > > @@ -22,6 +22,86 @@
> > > >
> > > >  #include <asm/page.h>
> > > >
> > > > +char *fdt_get_string(u32 offset,
> > > > +			  struct boot_param_header *blob)
> > >
> > > nitpicking: Encouraged naming convention is of_flat_dt_* for this
> > > file.  Also, I think it makes more sense for blob to be the first
> > > argument in all of these functions.
> >
> > OK... Half of the other functions don't follow that convention,
tho...
> > :)
> 
> I know.  It's a mess.  But I need to start with something to start
> regaining sanity.  :)

I thought about this some more and I do think it makes sense to have the
'generic' functions in a separate namespace, since they really are
distinguished in usage from the others marked __init.  I started off
naming
these all *_blob, but the names were really ugly, especially since the
functions
that are getting refactored are the ones that already fail to follow the
convention.

Proposal: if/when the other functions get factored into a separate file,
they
should be renamed to be of_early_flat_dt_*.

Steve

This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.




More information about the devicetree-discuss mailing list