]> git.baikalelectronics.ru Git - kernel.git/commit
USB: core: Update kerneldoc for usb_get_dev() and usb_get_intf()
authorAlan Stern <stern@rowland.harvard.edu>
Fri, 25 Feb 2022 14:38:25 +0000 (09:38 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Feb 2022 15:53:41 +0000 (16:53 +0100)
commit16da1822d6ee04fb1322d1a94ef9eeca994034bb
treea3d63d997ee6d733e43759df8822309e527d050c
parentbc6fec64fef7dc518e4da6d1971d01bf91ea464e
USB: core: Update kerneldoc for usb_get_dev() and usb_get_intf()

The kerneldoc for usb_get_dev() and usb_get_intf() says that drivers
should always refcount the references they hold for the usb_device or
usb_interface structure, respectively.  But this is an overstatement:
In many cases drivers do not access these references after they have
been unbound, and in such cases refcounting is unnecessary.

This patch updates the kerneldoc for the two routines, explaining when
a driver does not need to increment and decrement the refcount.  This
should help dispel misconceptions which might otherwise afflict
programmers new to the USB subsystem.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/Yhjp4Rp9Alipmwtq@rowland.harvard.edu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/usb.c