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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux