summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-09-01 04:45:05 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-09-01 04:45:05 +0300
commit498012511a060575a56551d28a10bb392aa361b5 (patch)
treed9dd9060eb6b3037804eca8e22056e7cdb1a26dd /include
parent5d2a1a927d487d6bb60c87b837d82702d8ebcaad (diff)
parent4bf011815f2e093c7f60004f4f5683cf40b905b9 (diff)
downloadlinux-498012511a060575a56551d28a10bb392aa361b5.tar.xz
Merge branch 'device-properties'
* device-properties: device property: check fwnode type in to_of_node() device property: attach 'else if' to the proper 'if' device property: fallback to pset when gettng one string device property: fix potential NULL pointer dereference
Diffstat (limited to 'include')
-rw-r--r--include/linux/of.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/of.h b/include/linux/of.h
index edc068d19c79..2194b8ca41f9 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -136,7 +136,8 @@ static inline bool is_of_node(struct fwnode_handle *fwnode)
static inline struct device_node *to_of_node(struct fwnode_handle *fwnode)
{
- return fwnode ? container_of(fwnode, struct device_node, fwnode) : NULL;
+ return is_of_node(fwnode) ?
+ container_of(fwnode, struct device_node, fwnode) : NULL;
}
static inline bool of_have_populated_dt(void)