Re: [PATCH 1/5] iio: inkern: introduce devm_iio_map_array_register() short-hand function
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: 2021-09-03 13:40:37
Also in:
linux-iio, lkml
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: 2021-09-03 13:40:37
Also in:
linux-iio, lkml
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