mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 00:34:52 +00:00
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>
This commit is contained in:
parent
71ec6f4f73
commit
4fb373dfab
1 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue