[PATCH v17 01/12] power: reset: reboot-mode: Remove devres based allocations

Bartosz Golaszewski bartosz.golaszewski at linaro.org
Mon Nov 10 05:10:53 PST 2025


On Sun, 9 Nov 2025 at 15:38, Shivendra Pratap
<shivendra.pratap at oss.qualcomm.com> wrote:
>
> Devres APIs are intended for use in drivers, and they should be
> avoided in shared subsystem code which is being used by multiple
> drivers. Avoid using devres based allocations in the reboot-mode
> subsystem and manually free the resources.
>

You're making it sound as if there's some race condition going on.
That's not the reason. They should be avoided in subsystem code
because you have no guarantee that the function will be called after
the driver is attached to the device nor that it will not be
referenced after the managed resources were released after a driver
detach. It's about life-times not synchronization.

Bart



More information about the linux-arm-kernel mailing list