diff options
| author | Archit Anant <architanant5@gmail.com> | 2026-04-12 15:07:39 +0530 |
|---|---|---|
| committer | Jonathan Cameron <jic23@kernel.org> | 2026-04-27 09:58:21 +0100 |
| commit | 99d709987276632a9260dc75e36c15e61b4b5083 (patch) | |
| tree | 9c555b3cfe41c2a9d47679ff6c477deddb453492 /tools/perf/scripts/python | |
| parent | 97c3fae0dbc4bf62eac7a1798b723c258e85980d (diff) | |
iio: adc: ad799x: convert to fully managed resources and drop remove()
Convert the driver's remaining manual resource management to use the
devm_ infrastructure, allowing for the complete removal of the
ad799x_remove() function and the simplification of the probe error paths.
Specifically:
- Initialize the mutex using devm_mutex_init() and move it to the top
of probe() (before IRQ registration) to prevent a race condition where
an interrupt could attempt to take an uninitialized lock.
- Use devm_add_action_or_reset() to ensure that the VCC and VREF
regulators are disabled safely and in the correct order during driver
teardown or probe failure.
- Refactor the optional VREF error handling path for better readability.
- Convert iio_triggered_buffer_setup() and iio_device_register() to
their devm_ variants.
Because all resources are now managed by the devm core, the unwinding
order is guaranteed to follow the reverse order of allocation. All manual
error handling goto labels in ad799x_probe() have been removed.
Suggested-by: Jonathan Cameron <jic23@kernel.org>
Suggested-by: David Lechner <dlechner@baylibre.com>
Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Archit Anant <architanant5@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
