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


Groups > linux.kernel > #1658872

Re: [PATCH 2/7] USB: of: document reference taken by child-lookup helper

From Johan Hovold <johan@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 2/7] USB: of: document reference taken by child-lookup helper
Date 2017-06-06 17:40 +0200
Message-ID <tPoKm-2cf-9@gated-at.bofh.it> (permalink)
References <tMSbT-1dJ-3@gated-at.bofh.it> <tMSlA-1h4-21@gated-at.bofh.it> <tMY7D-4OE-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, May 30, 2017 at 03:40:03PM -0700, Tyrel Datwyler wrote:
> 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

I updated the comment to use a version of this also found in drivers/of:

 * Return: A pointer to the node with incremented refcount if found, or
 * %NULL otherwise.

which is on kernel-doc format. I don't think we need to explicitly
mention which function to manipulate the refcount with in every header.

Thanks,
Johan

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/7] driver core/USB/thermal: fix device-tree node reuse Johan Hovold <johan@kernel.org> - 2017-05-30 18:30 +0200
  [PATCH 4/7] driver core: fix automatic pinctrl management Johan Hovold <johan@kernel.org> - 2017-05-30 18:30 +0200
    Re: [PATCH 4/7] driver core: fix automatic pinctrl management Linus Walleij <linus.walleij@linaro.org> - 2017-05-31 02:40 +0200
      Re: [PATCH 4/7] driver core: fix automatic pinctrl management Johan Hovold <johan@kernel.org> - 2017-05-31 10:40 +0200
  [PATCH 2/7] USB: of: document reference taken by child-lookup helper Johan Hovold <johan@kernel.org> - 2017-05-30 18:40 +0200
    Re: [PATCH 2/7] USB: of: document reference taken by child-lookup  helper Tyrel Datwyler <tyreld@linux.vnet.ibm.com> - 2017-05-31 00:50 +0200
      Re: [PATCH 2/7] USB: of: document reference taken by child-lookup  helper Johan Hovold <johan@kernel.org> - 2017-06-06 17:40 +0200
  [PATCH 6/7] thermal: max77620: fix device-node reference imbalance Johan Hovold <johan@kernel.org> - 2017-05-30 18:40 +0200
    Re: [PATCH 6/7] thermal: max77620: fix device-node reference  imbalance Tyrel Datwyler <tyreld@linux.vnet.ibm.com> - 2017-05-31 01:00 +0200
      Re: [PATCH 6/7] thermal: max77620: fix device-node reference  imbalance Johan Hovold <johan@kernel.org> - 2017-05-31 10:30 +0200

csiph-web