summaryrefslogtreecommitdiffstats
path: root/drivers/of/platform.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2016-11-01 11:53:22 +0100
committerRob Herring <robh@kernel.org>2016-11-15 09:17:19 -0600
commit4fb373dfabee1367b7553003b4d6491ee8bf4c2a (patch)
tree0f956e43175630b0a72ca9b4daa983bace592863 /drivers/of/platform.c
parent71ec6f4f7314d4d3ac44bae038bd748bd7961dc6 (diff)
downloadop-kernel-dev-4fb373dfabee1367b7553003b4d6491ee8bf4c2a.zip
op-kernel-dev-4fb373dfabee1367b7553003b4d6491ee8bf4c2a.tar.gz
of/platform: clarify of_find_device_by_node refcounting
Add comment clarifying that of_find_device_by_node() takes a reference to the embedded struct device which needs to be dropped after use. Note that most current users fail to do so. Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers/of/platform.c')
-rw-r--r--drivers/of/platform.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index cb4c780..b8064bc 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -45,6 +45,9 @@ static int of_dev_node_match(struct device *dev, void *data)
* of_find_device_by_node - Find the platform_device associated with a node
* @np: Pointer to device tree node
*
+ * Takes a reference to the embedded struct device which needs to be dropped
+ * after use.
+ *
* Returns platform_device pointer, or NULL if not found
*/
struct platform_device *of_find_device_by_node(struct device_node *np)
OpenPOWER on IntegriCloud