Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1513213 > unrolled thread

[PATCH 2/2] of/platform: clarify of_find_device_by_node refcounting

Started byJohan Hovold <johan@kernel.org>
First post2016-11-01 12:00 +0100
Last post2016-11-01 12:00 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/2] of/platform: clarify of_find_device_by_node refcounting Johan Hovold <johan@kernel.org> - 2016-11-01 12:00 +0100

#1513213 — [PATCH 2/2] of/platform: clarify of_find_device_by_node refcounting

FromJohan Hovold <johan@kernel.org>
Date2016-11-01 12:00 +0100
Subject[PATCH 2/2] of/platform: clarify of_find_device_by_node refcounting
Message-ID<syEXn-7Bz-11@gated-at.bofh.it>
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>
---
 drivers/of/platform.c | 3 +++
 1 file changed, 3 insertions(+)

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)
-- 
2.7.3

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web