Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4fb373df authored by Johan Hovold's avatar Johan Hovold Committed by Rob Herring
Browse files

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: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
parent 71ec6f4f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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)