]> git.ipfire.org Git - thirdparty/linux.git/commit
iio: tcs3472: use devm for resource management
authorAldo Conte <aldocontelk@gmail.com>
Fri, 22 May 2026 12:34:16 +0000 (14:34 +0200)
committerJonathan Cameron <jic23@kernel.org>
Sun, 31 May 2026 10:01:48 +0000 (11:01 +0100)
commitdf94df71711516298719a4507a792f0bb9fd0837
tree27e879a1cf2ecab7f899f824f33a88b76c4ccf49
parent2e84e69c92233b601e3892887aec7c56fd4fe13b
iio: tcs3472: use devm for resource management

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@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/light/tcs3472.c