Re: [PATCH 0/7] Simplify codes with devm_add_action_or_reset

Alexandru Ardelean
2021-04-08T13:15:06Z

On Thu, Apr 8, 2021 at 2:41 PM Yicong Yang <yangyicong@hisilicon.com> wrote:
>
> Some devm variants are implemented with devres_alloc() and devres_add()
> manually to only manage a single pointer. This can be simplified with
> devm_add_action_or_reset() which works the same. Simplify these functions.
>

Series looks good.
There are a few elements that are a bit strange (from a habit perspective).

For the devm_add_action_or_reset() callback usually there's a cast being done.
But that's a preference I don't feel too strongly about.

> Yicong Yang (7):
> iio: adc: adi-axi-adc: simplify devm_adi_axi_adc_conv_register
> iio: buffer-dmaengine: simplify __devm_iio_dmaengine_buffer_free
> iio: hw_consumer: simplify devm_iio_hw_consumer_alloc
> iio: triggered-buffer: simplify devm_iio_triggered_buffer_setup_ext
> iio: core: simplify some devm functions
> iio: trigger: simplify __devm_iio_trigger_register
> iio: inkern: simplify some devm functions
>
> drivers/iio/adc/adi-axi-adc.c | 22 ++++----
> drivers/iio/buffer/industrialio-buffer-dmaengine.c | 22 ++++----
> drivers/iio/buffer/industrialio-hw-consumer.c | 25 ++++-----
> drivers/iio/buffer/industrialio-triggered-buffer.c | 19 ++-----
> drivers/iio/industrialio-core.c | 43 ++++++---------
> drivers/iio/industrialio-trigger.c | 18 ++-----
> drivers/iio/inkern.c | 61 ++++++++--------------
> 7 files changed, 78 insertions(+), 132 deletions(-)
>
> --
> 2.8.1
>