Re: [PATCH] iio: adc: ad799x: use devm_iio_device_register and devm buffer setup

From: David Lechner

Date: Sat Feb 28 2026 - 11:36:18 EST


On 2/28/26 9:45 AM, Archit Anant wrote:
> Convert the driver to use the device-managed versions of
> iio_device_register() and iio_triggered_buffer_setup().
>
> This simplifies the error handling in ad799x_probe() by removing the
> 'error_cleanup_ring' goto label. It also removes the need to manually
> call iio_device_unregister() and iio_triggered_buffer_cleanup() in
> ad799x_remove().
>
Since we are doing this, why not also handle the regulators and
rx_buf so that we can drop the remove() function completely?