lkml.org 
[lkml]   [2018]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC/PATCH 2/5] device property: introduce notion of subnodes for legacy boards
On Wed, Sep 19, 2018 at 10:13:26AM -0700, Dmitry Torokhov wrote:
> > > diff --git a/drivers/base/pset_property.c b/drivers/base/pset_property.c
> > > index 08ecc13080ae..63f2377aefe8 100644
> > > --- a/drivers/base/pset_property.c
> > > +++ b/drivers/base/pset_property.c
> > > @@ -18,6 +18,11 @@ struct property_set {
> > > struct device *dev;
> > > struct fwnode_handle fwnode;
> > > const struct property_entry *properties;
> > > +
> > > + struct property_set *parent;
> > > + /* Entry in parent->children list */
> > > + struct list_head child_node;
> > > + struct list_head children;
> >
> > Add
> >
> > const char *name;
> >
> > and you can implement also pset_get_named_child_node().
>
> Or
> char name[];
>
> to avoid separate allocation.

Let's not do that, especially if you are planning on exporting this
structure. If the name is coming from .rodata, there is no need to
allocate anything for the name. Check kstrdup_const().

> Alternatively, we can add it later when we need it, and add
> device_add_named_child_properties().
>
> I'll leave it up to Rafael to decide.

Fair enough.


Thanks,

--
heikki

\
 
 \ /
  Last update: 2018-09-20 12:23    [W:0.093 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site