Re: [PATCH v3 5/8] iio: tcs3472: use devm for resource management

From: Jonathan Cameron

Date: Tue May 26 2026 - 09:04:01 EST


On Fri, 22 May 2026 14:34:16 +0200
Aldo Conte <aldocontelk@xxxxxxxxx> wrote:

> Convert the driver to use device-managed resource allocation:
> - Add tcs3472_powerdown_action() and register it with
> devm_add_action_or_reset() to ensure the device is powered down on
> cleanup.
> - Replace iio_triggered_buffer_setup() with
> devm_iio_triggered_buffer_setup().
> - Replace request_threaded_irq() with devm_request_threaded_irq().
> - Replace iio_device_register() with devm_iio_device_register().
> - Replace mutex_init() with devm_mutex_init().
> - Remove tcs3472_remove() as all cleanup is now handled by devm.
>
> Use a local 'dev = &client->dev' in tcs3472_probe() to keep the devm
> calls compact.
>
> Signed-off-by: Aldo Conte <aldocontelk@xxxxxxxxx>
Applied to the testing branch of iio.git.

Thanks,

Jonathan