From: Johan Hovold Date: Tue, 1 Nov 2016 10:53:22 +0000 (+0100) Subject: of/platform: clarify of_find_device_by_node refcounting X-Git-Tag: rel_imx_4.19.35_1.1.0~13533^2~12 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=4fb373dfabee1367b7553003b4d6491ee8bf4c2a;p=linux.git 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 Signed-off-by: Rob Herring --- diff --git a/drivers/of/platform.c b/drivers/of/platform.c index cb4c7800f37d..b8064bc2b6eb 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -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)