[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAASAkoa0D7++CW6ua0_-9LWxhtchG_dKDOih6Ho2NH2gGdtvrQ@mail.gmail.com>
Date: Fri, 3 Sep 2021 16:56:43 +0300
From: Alexandru Ardelean <aardelean@...iqon.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: linux-iio <linux-iio@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-doc@...r.kernel.org, Jonathan Cameron <jic23@...nel.org>,
hdegoede@...hat.com, wens@...e.org
Subject: Re: [PATCH 1/5] iio: inkern: introduce devm_iio_map_array_register()
short-hand function
On Fri, 3 Sept 2021 at 16:40, Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
> 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?
So, this brings me back to an older discussion about devm_ when I
thought about making some devm_ function that implicitly takes uses
the parent of the IIO device.
Jonathan mentioned that if we go that route, maybe we should prefix it
with iiom_ .
But we weren't sure at the time if that makes sense.
The idea was to bind the management of the unwinding to either the
parent of the IIO device, or the IIO device itself (indio_dev->dev).
We kind of concluded that it may probably not be a good to hide
anything and make standard a devm_ function with an explicit 'dev'
object parameter.
I found a recent mention here (while searching for iiom_ on linux-iio):
https://lore.kernel.org/linux-iio/20210313192150.74c0a91b@archlinux/
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
Powered by blists - more mailing lists