Messages in this thread | | | From | Grant Likely <> | Date | Wed, 7 May 2014 16:21:09 +0100 | Subject | Re: [RFC PATCH 2/3] devicetree: provide hook to allow setting devicetree device name |
| |
On Wed, May 7, 2014 at 1:52 AM, Frank Rowand <frowand.list@gmail.com> wrote: > From: Frank Rowand <frank.rowand@sonymobile.com> > > Optionally push devicetree device naming into a function called dynamically by > of_device_alloc(). > > TODO: > Change made to of_device_alloc() could also be made to > of_amba_device_create() > > Signed-off-by: Frank Rowand <frank.rowand@sonymobile.com> > --- > drivers/of/platform.c | 2 ++ > include/linux/of.h | 2 ++ > 3 files changed, 43 insertions(+) > > Index: b/drivers/of/platform.c > =================================================================== > --- a/drivers/of/platform.c > +++ b/drivers/of/platform.c > @@ -179,6 +179,8 @@ struct platform_device *of_device_alloc( > > if (bus_id) > dev_set_name(&dev->dev, "%s", bus_id); > + else if (np->parent->of_device_make_bus_id) > + np->parent->of_device_make_bus_id(&dev->dev);
This isn't dangerous in the way the first patch is, but I don't want to expose control over the naming scheme outside of the core code. It would be too easy to get wrong and mess up other drivers. The problem that is being hit is clearly a bug in the core DT code. It should be naming devices so that there isn't a conflict. I think Rob's suggested patch is the best fix.
g.
| |