Re: [RFC PATCH 2/3] devicetree: provide hook to allow setting devicetree device name

From: Grant Likely
Date: Wed May 07 2014 - 11:22:07 EST


On Wed, May 7, 2014 at 1:52 AM, Frank Rowand <frowand.list@xxxxxxxxx> wrote:
> From: Frank Rowand <frank.rowand@xxxxxxxxxxxxxx>
>
> 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@xxxxxxxxxxxxxx>
> ---
> 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/