Re: [PATCH 1/5] iio: inkern: introduce devm_iio_map_array_register() short-hand function

From: Andy Shevchenko
Date: Fri Sep 03 2021 - 09:40:38 EST


On Fri, Sep 03, 2021 at 10:29:13AM +0300, Alexandru Ardelean wrote:
> This change introduces a device-managed variant to the
> iio_map_array_register() function. It's a simple implementation of calling
> iio_map_array_register() and registering a callback to
> iio_map_array_unregister() with the devm_add_action_or_reset().
>
> The function uses an explicit 'dev' parameter to bind the unwinding to. It
> could have been implemented to implicitly use the parent of the IIO device,
> however it shouldn't be too expensive to callers to just specify to which
> device object to bind this unwind call.
> It would make the API a bit more flexible.

AFAIU this dev pointer is kinda discussable thing. What scenario do you expect
(have in mind) when it shouldn't use parent?

--
With Best Regards,
Andy Shevchenko