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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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);
 	else
 		of_device_make_bus_id(&dev->dev);
 
Index: b/include/linux/of.h
===================================================================
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -17,6 +17,7 @@
  */
 #include <linux/types.h>
 #include <linux/bitops.h>
+#include <linux/device.h>
 #include <linux/errno.h>
 #include <linux/kobject.h>
 #include <linux/mod_devicetable.h>
@@ -60,6 +61,7 @@ struct device_node {
 	struct	kobject kobj;
 	unsigned long _flags;
 	void	*data;
+	void    (*of_device_make_bus_id)(struct device *dev);
 #if defined(CONFIG_SPARC)
 	const char *path_component_name;
 	unsigned int unique_id;
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux