Skip to contentSkip to conversation

Driver core: Add accessor for device tree node

PATCH In review Jingoo Han 2 participants 3 messages Jul 30, 2013 – Jul 31, 2013 Driver core

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/1 Driver core: Add accessor for device tree node

Add the wrapper function for retrieving device tree node instead of accessing dev->of_node directly.

---
 include/linux/device.h |    5 +++++
 1 file changed, 5 insertions(+)
include/linux/device.h +5 -0
index 22b546a..4faaa51 100644
@@ -917,6 +917,11 @@ static inline void *dev_get_platdata(const struct device *dev)
 	return dev->platform_data;
 }
 
+static inline void *dev_get_of_node(const struct device *dev)
+{
+	return dev->of_node;
+}
+
 /*
  * Manual binding of a device to driver. See drivers/base/bus.c
  * for information on use.
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 2 lines · Jingoo Han

Add the wrapper function for retrieving device tree node instead of accessing dev->of_node directly.

Why?

author
#2 lore raw
Quoted 5 lines · Greg Kroah-Hartman
Quoted 2 lines · Jingoo Han

Add the wrapper function for retrieving device tree node instead of accessing dev->of_node directly.

Why?

Sorry, I cannot find the special reason why it should be used. Please, ignore it. :)
Thanks.

Best regards,
Jingoo Han