Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Johan Hovold and committed by
Rob Herring
4fb373df 71ec6f4f

+3
+3
drivers/of/platform.c
··· 45 45 * of_find_device_by_node - Find the platform_device associated with a node 46 46 * @np: Pointer to device tree node 47 47 * 48 + * Takes a reference to the embedded struct device which needs to be dropped 49 + * after use. 50 + * 48 51 * Returns platform_device pointer, or NULL if not found 49 52 */ 50 53 struct platform_device *of_find_device_by_node(struct device_node *np)