summaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-11-13 20:36:37 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-13 20:36:37 -0800
commit3c073991eb417b6f785ddc6afbbdc369eb84aa6a (patch)
tree0c1f3f2d919b5c9f096cdd2d4094a998df8537ef /drivers/base
parent04ed510988f278a69872b4cdb426e565e3236215 (diff)
parent5e4b1b707b7ed795585b8ee28c44ce692aa8dfef (diff)
downloadop-kernel-dev-3c073991eb417b6f785ddc6afbbdc369eb84aa6a.zip
op-kernel-dev-3c073991eb417b6f785ddc6afbbdc369eb84aa6a.tar.gz
Merge tag 'devprop-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull device properties framework updates from Rafael Wysocki: "These make the fwnode_handle_get() function return a pointer to the target fwnode object, which reflects the of_node_get() behavior, and add a macro for iterating over graph endpoints (Sakari Ailus)" * tag 'devprop-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: device property: Add a macro for interating over graph endpoints device property: Make fwnode_handle_get() return the fwnode
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/property.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/base/property.c b/drivers/base/property.c
index 7ed99c1..851b1b6 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -1044,10 +1044,15 @@ EXPORT_SYMBOL_GPL(device_get_named_child_node);
/**
* fwnode_handle_get - Obtain a reference to a device node
* @fwnode: Pointer to the device node to obtain the reference to.
+ *
+ * Returns the fwnode handle.
*/
-void fwnode_handle_get(struct fwnode_handle *fwnode)
+struct fwnode_handle *fwnode_handle_get(struct fwnode_handle *fwnode)
{
- fwnode_call_void_op(fwnode, get);
+ if (!fwnode_has_op(fwnode, get))
+ return fwnode;
+
+ return fwnode_call_ptr_op(fwnode, get);
}
EXPORT_SYMBOL_GPL(fwnode_handle_get);
OpenPOWER on IntegriCloud