Skip to contentSkip to conversation

of/device: Make of_device_make_bus_id() usable by other code.

PATCH In review Grant Likely 2 participants 3 messages Jul 24, 2010 – Jul 25, 2010 Device tree

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 of/device: Make of_device_make_bus_id() usable by other code.

The AMBA bus should also use of_device_make_bus_id() when populating device out of device tree data. This patch makes the function non-static, and adds a suitable prototype in of_device.h

---
 drivers/of/platform.c     |    2 +-
 include/linux/of_device.h |    3 +++
 2 files changed, 4 insertions(+), 1 deletions(-)
drivers/of/platform.c +1 -1
index 94fa719..600d77f 100644
@@ -508,7 +508,7 @@ EXPORT_SYMBOL(of_unregister_driver);
  * value to derive a unique name.  As a last resort it will use the node
  * name followed by a unique number.
  */
-static void of_device_make_bus_id(struct device *dev)
+void of_device_make_bus_id(struct device *dev)
 {
 	static atomic_t bus_no_reg_magic;
 	struct device_node *node = dev->of_node;
include/linux/of_device.h +3 -0
index e11a0be..249bc11 100644
@@ -27,6 +27,9 @@
 
 extern const struct of_device_id *of_match_device(
 	const struct of_device_id *matches, const struct device *dev);
+#if !defined(CONFIG_SPARC)
+extern void of_device_make_bus_id(struct device *dev);
+#endif
 
 /**
  * of_driver_match_device - Tell if a driver's of_match_table matches a device.
#1 lore raw

Hi Grant,

include/linux/of_device.h line 32

Quoted 12 lines · On Sat, 24 Jul 2010 10:01:11 -0600 Grant Likely…
include/linux/of_device.h +3 -0
index e11a0be..249bc11 100644
@@ -27,6 +27,9 @@
 
 extern const struct of_device_id *of_match_device(
 	const struct of_device_id *matches, const struct device *dev);
+#if !defined(CONFIG_SPARC)
+extern void of_device_make_bus_id(struct device *dev);
+#endif

You don't really need the protection here - it does not clash with anything on SPARC, right?

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/

_______________________________________________
devicetree-discuss mailing list devicetree-discuss-uLR06cmDAlY/[email protected]
https://lists.ozlabs.org/listinfo/devicetree-discuss

#2 lore raw
Quoted 10 lines · Stephen Rothwell

Hi Grant,

Quoted 7 lines · On Sat, 24 Jul 2010 10:01:11 -0600 Grant Likely <[email protected]>…
include/linux/of_device.h +0 -0
index e11a0be..249bc11 100644
@@ -27,6 +27,9 @@
 
Quoted 8 lines

include/linux/of_device.h line 32

Quoted 5 lines

 extern const struct of_device_id *of_match_device(
      const struct of_device_id *matches, const struct device *dev);

include/linux/of_device.h +3 -0
+#if !defined(CONFIG_SPARC)
+extern void of_device_make_bus_id(struct device *dev);
+#endif

You don't really need the protection here - it does not clash with anything on SPARC, right?

No, it doesn't conflict with anything. I'll drop the if !defined() wrapper.

g.

Signature · 2 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.