of/platform: clarify of_find_device_by_node refcounting
authorJohan Hovold <johan@kernel.org>
Tue, 1 Nov 2016 10:53:22 +0000 (11:53 +0100)
committerRob Herring <robh@kernel.org>
Tue, 15 Nov 2016 15:17:19 +0000 (09:17 -0600)
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>
drivers/of/platform.c

index cb4c7800f37ddfd68d405a61536dc259bc95571d..b8064bc2b6eb97a29d330f2713ce221adcc6313a 100644 (file)
@@ -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)