lkml.org 
[lkml]   [2018]   [Sep]   [19]   [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
Hi Heikki,

On Wed, Sep 19, 2018 at 06:10:26PM +0300, Heikki Krogerus wrote:
> Hi,
>
> On Mon, Sep 17, 2018 at 11:16:00AM -0700, Dmitry Torokhov wrote:
> > Several drivers rely on having notion of sub-nodes when describing
> > hardware, let's allow static board-defined properties also have it.
> >
> > The board files will then attach properties to devices in the following
> > fashion:
> >
> > device_add_properties(&board_platform_device.dev,
> > main_device_props);
> > device_add_child_properties(&board_platform_device.dev,
> > dev_fwnode(&board_platform_device.dev),
> > child1_device_props);
> > device_add_child_properties(&board_platform_device.dev,
> > dev_fwnode(&board_platform_device.dev),
> > child2_device_props);
> > ...
> > platform_device_register(&board_platform_device.dev);
> >
> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > ---
> > drivers/base/pset_property.c | 110 +++++++++++++++++++++++++++++++----
> > include/linux/property.h | 4 ++
> > 2 files changed, 102 insertions(+), 12 deletions(-)
> >
> > 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.

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.

Thanks.

--
Dmitry

\
 
 \ /
  Last update: 2018-09-19 19:14    [W:0.130 / U:1.820 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site