mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Akshay Jindal <akshayaj.lkd@gmail.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Andy Shevchenko <andriy.shevchenko@intel.com>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	anshulusr@gmail.com, dlechner@baylibre.com, nuno.sa@analog.com,
	andy@kernel.org, shuah@kernel.org, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: light: ltr390: Add remove callback with needed support in device registration
Date: Mon, 11 Aug 2025 21:25:33 +0100	[thread overview]
Message-ID: <20250811212533.341e7c44@jic23-huawei> (raw)
In-Reply-To: <CAE3SzaRZGvOwi0UeBU9Nw2=_jwF9AYLyY0BFG9tHzwbMFv1o7g@mail.gmail.com>

On Mon, 11 Aug 2025 02:18:34 +0530
Akshay Jindal <akshayaj.lkd@gmail.com> wrote:

> On Sun, Aug 10, 2025 at 2:04 AM Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
> >
> > On Sat, Aug 9, 2025 at 9:57 PM Jonathan Cameron <jic23@kernel.org> wrote:  
> > > On Sat, 9 Aug 2025 12:53:40 +0300
> > > Andy Shevchenko <andriy.shevchenko@intel.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@intel.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@gmail.com> wrote:  
> > > > > > > > On Tue, Aug 5, 2025 at 6:05 AM Akshay Jindal <akshayaj.lkd@gmail.com> wrote:  
> > > > > > > > > On Tue, Aug 5, 2025 at 2:36 AM Andy Shevchenko
> > > > > > > > > <andy.shevchenko@gmail.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.
> 


  reply	other threads:[~2025-08-11 20:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-04 19:25 Akshay Jindal
2025-08-04 21:05 ` Andy Shevchenko
2025-08-05  4:05   ` Akshay Jindal
2025-08-05 12:47     ` Andy Shevchenko
2025-08-06 15:18       ` Jonathan Cameron
2025-08-06 20:02         ` Andy Shevchenko
2025-08-07 13:04           ` Jonathan Cameron
2025-08-09  9:53             ` Andy Shevchenko
2025-08-09 19:57               ` Jonathan Cameron
2025-08-09 20:34                 ` Andy Shevchenko
2025-08-10 20:48                   ` Akshay Jindal
2025-08-11 20:25                     ` Jonathan Cameron [this message]
2025-08-08 14:23       ` Akshay Jindal
2025-08-08 14:33         ` Andy Shevchenko
2025-08-08 14:55           ` Akshay Jindal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250811212533.341e7c44@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=akshayaj.lkd@gmail.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=andy@kernel.org \
    --cc=anshulusr@gmail.com \
    --cc=dlechner@baylibre.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®