Driver core: Add accessor for device tree node
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.
Signed-off-by Jingoo Han <[email protected]>
--- include/linux/device.h | 5 +++++ 1 file changed, 5 insertions(+)
include/linux/device.h +5 -0
@@ -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
Greg Kroah-Hartman
maintainerQuoted 2 lines · Jingoo Han
Add the wrapper function for retrieving device tree node instead of accessing
dev->of_nodedirectly.
Why?
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_nodedirectly.Why?
Sorry, I cannot find the special reason why it should be used. Please, ignore it. :)
Thanks.
Best regards,
Jingoo Han