Re: [PATCH v2] nvmem: don't use devres in subsystem code
From: Srinivas Kandagatla
Date: Tue Dec 01 2026 - 08:48:50 EST
On Wed, 28 Oct 2026 12:33:08 +0100, Bartosz Golaszewski wrote:
> Using device-managed APIs at sub-system level can cause issues due to
> lack of a strict API contract, especially when relying on managed
> resources being freed on device release. Devres should only be used in
> drivers, ideally only when it's bound to a driver.
>
> In nvmem, the release of the memory allocated for sysfs attributes,
> happens when the last reference to nvmem->dev is dropped, not in
> nvmem_unregister(). This means that consumer holding references to nvmem
> devices keep the memory around after sysfs files are gone which happens
> in device_del().
>
> [...]
Applied, thanks!
[1/1] nvmem: don't use devres in subsystem code
commit: 96139b973a2a51bdbf230fc95c015afe41830072
Best regards,
--
Srinivas Kandagatla <srini@xxxxxxxxxx>