Re: [PATCH v2] iio: adc: ad799x: convert to fully managed resources
From: Andy Shevchenko
Date: Mon Mar 02 2026 - 03:13:37 EST
On Mon, Mar 02, 2026 at 10:55:59AM +0530, Archit Anant wrote:
> Refactor the driver to use device-managed allocations and actions,
> allowing for the complete removal of the ad799x_remove() function
> and simplifying the error paths in probe().
>
> Key changes:
> - Replace the dynamic rx_buf allocation with a fixed-size, DMA-safe
> buffer using IIO_DECLARE_DMA_BUFFER_WITH_TS() in the state struct.
> This avoids memory leaks during scan mode updates and removes the
> need for manual kfree().
> - Cache the VCC and VREF voltages in the state structure during probe()
> to avoid querying the regulator API during fast-path read_raw() calls.
> - Use devm_add_action_or_reset() to register regulator_disable()
> callbacks for both VCC and VREF regulators.
> - Convert iio_triggered_buffer_setup() and iio_device_register() to
> their devm_ variants, ensuring safe, reverse-order unwinding.
Seems like a series squashed into a single patch, please resplit.
--
With Best Regards,
Andy Shevchenko