Re: [PATCH v17 01/12] power: reset: reboot-mode: Remove devres based allocations
From: Bartosz Golaszewski
Date: Mon Nov 10 2025 - 08:13:00 EST
On Sun, 9 Nov 2025 at 15:38, Shivendra Pratap
<shivendra.pratap@xxxxxxxxxxxxxxxx> 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