Skip to content

Commit 698cd2d

Browse files
brooniegregkh
authored andcommitted
devres: Clarify documentation for devres_destroy()
It's not massively obvious (at least to me) that removing and freeing a resource does not involve calling the release function for the resource but rather only removes the management of it. Make the documentation more explicit. Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 9475818 commit 698cd2d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/base/devres.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ EXPORT_SYMBOL_GPL(devres_remove);
309309
* which @match returns 1. If @match is NULL, it's considered to
310310
* match all. If found, the resource is removed atomically and freed.
311311
*
312+
* Note that the release function for the resource will not be called,
313+
* only the devres-allocated data will be freed. The caller becomes
314+
* responsible for freeing any other data.
315+
*
312316
* RETURNS:
313317
* 0 if devres is found and freed, -ENOENT if not found.
314318
*/

0 commit comments

Comments
 (0)