[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250811212533.341e7c44@jic23-huawei>
Date: Mon, 11 Aug 2025 21:25:33 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Akshay Jindal <akshayaj.lkd@...il.com>
Cc: Andy Shevchenko <andy.shevchenko@...il.com>, Andy Shevchenko
<andriy.shevchenko@...el.com>, Jonathan Cameron
<Jonathan.Cameron@...wei.com>, anshulusr@...il.com, dlechner@...libre.com,
nuno.sa@...log.com, andy@...nel.org, shuah@...nel.org,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iio: light: ltr390: Add remove callback with needed
support in device registration
On Mon, 11 Aug 2025 02:18:34 +0530
Akshay Jindal <akshayaj.lkd@...il.com> wrote:
> On Sun, Aug 10, 2025 at 2:04 AM Andy Shevchenko
> <andy.shevchenko@...il.com> wrote:
> >
> > On Sat, Aug 9, 2025 at 9:57 PM Jonathan Cameron <jic23@...nel.org> wrote:
> > > On Sat, 9 Aug 2025 12:53:40 +0300
> > > Andy Shevchenko <andriy.shevchenko@...el.com> wrote:
> > > > On Thu, Aug 07, 2025 at 02:04:01PM +0100, Jonathan Cameron wrote:
> > > > > On Wed, 6 Aug 2025 23:02:44 +0300
> > > > > Andy Shevchenko <andriy.shevchenko@...el.com> wrote:
> > > > > > On Wed, Aug 06, 2025 at 04:18:01PM +0100, Jonathan Cameron wrote:
> > > > > > > On Tue, 5 Aug 2025 14:47:32 +0200
> > > > > > > Andy Shevchenko <andy.shevchenko@...il.com> wrote:
> > > > > > > > On Tue, Aug 5, 2025 at 6:05 AM Akshay Jindal <akshayaj.lkd@...il.com> wrote:
> > > > > > > > > On Tue, Aug 5, 2025 at 2:36 AM Andy Shevchenko
> > > > > > > > > <andy.shevchenko@...il.com> wrote:
> >
> > ...
> >
> > > > We can do it, but this sounds to me like a step back. Implementing proper PM
> > > > runtime callbacks is a step forward.
> > > I entirely agree that runtime PM is good to have and it does a lot more
> > > than just turning the power on and off once per probe / remove cycle.
>
> Initially, while working on a patch for this driver(sysfs for data
> freshness), while testing
> I needed to suspend the sensor but could not because the driver only supports
> system suspend and resume. At that time, I had made up my mind that I
> have to add
> runtime suspend support for this driver because before Andy's
> comments, I used to consider
> runtime PM support as a way to give control to users to do on-demand
> suspension and
> resuming sensor operations. But now I learnt that it is so much more.
>
> So Irrespective of the acceptance of this patch, my next patch was
> going to be runtime PM support.
>
> Will it be acceptable, that this driver like many other drivers have
> support for both remove callback
> and runtime PM?
Sounds good. Though you probably don't need an explicit remove callback,
just one more devm_add_action_or_reset().
That stuff just allows you to register the 'undo' immediately after the
'do' in probe which makes for easy to read code in many cases.
Jonathan
>
> Thanks,
> Akshay.
>
Powered by blists - more mailing lists