Skip to content

Commit

Permalink
of/platform: clarify of_find_device_by_node refcounting
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Rob Herring <[email protected]>
  • Loading branch information
jhovold authored and robherring committed Nov 15, 2016
1 parent 71ec6f4 commit 4fb373d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/of/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4fb373d

Please sign in to comment.