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: v4.14-rc1~1869^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4fb373dfabee1367b7553003b4d6491ee8bf4c2a;p=platform%2Fkernel%2Flinux-rpi.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 cb4c780..b8064bc 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)