(subset) [PATCH v2 0/7] Devm helpers for regulator get and enable

Mark Brown broonie at kernel.org
Tue Aug 16 04:31:31 PDT 2022


On Tue, Aug 16, 2022 at 11:06:21AM +0000, Vaittinen, Matti wrote:

> I wonder if writing such 'release callbacks' is compulsory? I mean, if I 
> was writing a driver to some new (to me) subsystem and was required to 
> write an explicit release-callback for a resource - then it'd surely 
> rang a bell about potentially double freeing stuff with devm. Especially 
> if the doc stated the callback can be called after the driver has been 
> detached.

Generally yes, thoguh people can and do leave them blank and it's easy
enough to do some cleanup in there that assumes that the device is still
present and not think the device might've gone away especially if the
hardware isn't practically hotpluggable.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-amlogic/attachments/20220816/966ca45b/attachment.sig>


More information about the linux-amlogic mailing list