diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2017-03-28 03:52:23 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-03-28 18:00:28 -0400 |
commit | 67831837e0b192fe0b8ee8b5e502d95ad2c497c0 (patch) | |
tree | f82c4e03dcb50a4c02a4bd3cefe2f411736bea05 /include/linux/of.h | |
parent | e7887c284969a23a98fe1aff2f631c5ccdcd1757 (diff) |
of: Add of_fwnode_handle() to convert device nodes to fwnode_handle
of_fwnode_handle() returns a struct fwnode_handle of the struct
device_node. This may be used on the fwnode property API.
Use a macro instead of a function in order to support const and non-const
arguments.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/of.h')
-rw-r--r-- | include/linux/of.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/of.h b/include/linux/of.h index 21e6323de0f3..e5d4225fda35 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -159,6 +159,8 @@ static inline struct device_node *to_of_node(struct fwnode_handle *fwnode) | |||
159 | container_of(fwnode, struct device_node, fwnode) : NULL; | 159 | container_of(fwnode, struct device_node, fwnode) : NULL; |
160 | } | 160 | } |
161 | 161 | ||
162 | #define of_fwnode_handle(node) (&(node)->fwnode) | ||
163 | |||
162 | static inline bool of_have_populated_dt(void) | 164 | static inline bool of_have_populated_dt(void) |
163 | { | 165 | { |
164 | return of_root != NULL; | 166 | return of_root != NULL; |
@@ -602,6 +604,8 @@ static inline struct device_node *of_find_node_with_property( | |||
602 | return NULL; | 604 | return NULL; |
603 | } | 605 | } |
604 | 606 | ||
607 | #define of_fwnode_handle(node) NULL | ||
608 | |||
605 | static inline bool of_have_populated_dt(void) | 609 | static inline bool of_have_populated_dt(void) |
606 | { | 610 | { |
607 | return false; | 611 | return false; |