lkml.org 
[lkml]   [2017]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/7] USB: of: document reference taken by child-lookup helper
From
Date
On 05/30/2017 09:25 AM, Johan Hovold wrote:
> Document that the child-node lookup helper takes a reference to the
> device-tree node which needs to be dropped after use.
>
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
> drivers/usb/core/of.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/usb/core/of.c b/drivers/usb/core/of.c
> index d563cbcf76cf..17a4af02cf5b 100644
> --- a/drivers/usb/core/of.c
> +++ b/drivers/usb/core/of.c
> @@ -28,6 +28,9 @@
> *
> * Find the node from device tree according to its port number.
> *
> + * Takes a reference to the returned device-tree node, which needs to be
> + * dropped after use.
> + *
> * Return: On success, a pointer to the device node, %NULL on failure.

I would use the same blurb used throughout drivers/of/* for consistency.

* Returns a node pointer with refcount incremented, use
* of_node_put() on it when done.
*/

Just my 2-cents

-Tyrel

> */
> struct device_node *usb_of_get_child_node(struct device_node *parent,
>

\
 
 \ /
  Last update: 2017-05-31 00:40    [W:0.123 / U:0.728 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site