Re: [PATCH v3 4/4] iio: adc: ad799x: use devm_iio_device_register and drop remove
From: Andy Shevchenko
Date: Mon Mar 02 2026 - 08:19:31 EST
On Mon, Mar 02, 2026 at 06:36:32PM +0530, Archit Anant wrote:
> Convert the driver to use the device-managed versions of
> iio_device_register() and iio_triggered_buffer_setup().
>
> Because all resources (buffer, regulators, IRQs, IIO device) are now
> managed by the devm core, the unwinding order is guaranteed to be
> safe and correct. We can safely remove all manual error handling goto
> labels in ad799x_probe() and delete the ad799x_remove() function
> entirely.
>
> This eliminates boilerplate code and prevents future resource leaks.
...
> mutex_init(&st->lock);
Missed devm_mutex_init().
--
With Best Regards,
Andy Shevchenko