Skip to content

Commit

Permalink
Documentation/auxiliary_bus: Clarify the release of devices from find…
Browse files Browse the repository at this point in the history
… device

auxiliary_find_device() takes a proper get_device() reference on the
device before returning the matched device.

Users of this call should be informed that they need to properly release
this reference with put_device().

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Link: https://lore.kernel.org/r/20211202044305.4006853-7-ira.weiny@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Ira Weiny authored and Greg Kroah-Hartman committed Dec 3, 2021
1 parent 14866a7 commit 8a2d6ff
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/base/auxiliary.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ EXPORT_SYMBOL_GPL(__auxiliary_device_add);
* This function returns a reference to a device that is 'found'
* for later use, as determined by the @match callback.
*
* The reference returned should be released with put_device().
*
* The callback should return 0 if the device doesn't match and non-zero
* if it does. If the callback returns non-zero, this function will
* return to the caller and not iterate over any more devices.
Expand Down

0 comments on commit 8a2d6ff

Please sign in to comment.