public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] base/core.c: improve comment of the function device_find_child()
@ 2013-04-12 11:59 Federico Vaga
  2013-04-12 21:51 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Federico Vaga @ 2013-04-12 11:59 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Federico Vaga

Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
---
 drivers/base/core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index 016312437..eb0c6ea 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1372,6 +1372,10 @@ int device_for_each_child(struct device *parent, void *data,
  * if it does.  If the callback returns non-zero and a reference to the
  * current device can be obtained, this function will return to the caller
  * and not iterate over any more devices.
+ *
+ * NOTE: internally, the function does get_device() on the retrieved child.
+ * It is duty of the caller performing a put_device() on the retrieved
+ * child device when the caller finishes to work on it.
  */
 struct device *device_find_child(struct device *parent, void *data,
 				 int (*match)(struct device *dev, void *data))
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-04-15  8:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-12 11:59 [PATCH] base/core.c: improve comment of the function device_find_child() Federico Vaga
2013-04-12 21:51 ` Greg Kroah-Hartman
2013-04-15  8:32   ` Federico Vaga

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox