mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Sean Nyekjaer <sean@geanix.com>
Cc: "Andy Shevchenko" <andy.shevchenko@gmail.com>,
	"Jean-Baptiste Maneyrol" <jean-baptiste.maneyrol@tdk.com>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Jean-Baptiste Maneyrol" <jmaneyrol@invensense.com>,
	"Jonathan Cameron" <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH v2 1/5] iio: imu: inv_icm42600: Simplify pm_runtime setup
Date: Sat, 30 Aug 2025 15:45:59 +0100	[thread overview]
Message-ID: <20250830154559.427969c6@jic23-huawei> (raw)
In-Reply-To: <6utm3ywkymr3hretvru7xkdv7p7p3wtmd62blfyapmgagr3pzc@42oiakgdxmqp>

On Mon, 25 Aug 2025 15:14:15 +0000
Sean Nyekjaer <sean@geanix.com> wrote:

> On Mon, Aug 11, 2025 at 02:21:26PM +0100, Sean Nyekjaer wrote:
> > On Sat, Aug 09, 2025 at 10:27:52PM +0100, Andy Shevchenko wrote:  
> > > On Sat, Aug 9, 2025 at 8:06 PM Jonathan Cameron <jic23@kernel.org> wrote:  
> > > > On Fri, 8 Aug 2025 23:37:51 +0200
> > > > Andy Shevchenko <andy.shevchenko@gmail.com> wrote:  
> > > > > On Fri, Aug 8, 2025 at 5:58 PM Sean Nyekjaer <sean@geanix.com> wrote:  
> > > 
> > > ...
> > >   
> > > > > > +       struct device *dev = regmap_get_device(st->map);
> > > > > >
> > > > > > +       if (!pm_runtime_status_suspended(dev))
> > > > > > +               regulator_disable(st->vddio_supply);  
> > > > >
> > > > > I would rather use positive conditional as it seems to me more scalable  
> > > >
> > > > To potentially save time when Sean looks at this.  I don't follow. Do you mean
> > > > something like
> > > >         if (pm_runtime_status_suspended(dev))
> > > >                 return;
> > > >
> > > >         regulator_disable(st->vddio_supply);
> > > >
> > > > ?  
> > > 
> > > Yes.
> > >   
> > > > If so I'm not seeing why we'd want this to scale as it's a single use
> > > > devm_set_action_or_reset() callback doing just one thing.  
> > > 
> > > While I agree in _this_ case, in general the check and return
> > > immediately is more scalable for reading purposes, e.g., indentation
> > > will be one level less. Also it won't require additional churn in
> > > adding {, i.e. changing conditional line just for that.
> > >   
> > 
> > I like the return early if pm_runtime_status_suspended() is true.
> > 
> > Andy, when doing reviews please keep the function name, as it's much
> > easier to add the changes.
> > 
> > Jonathan, do we think checking pm_runtime_status_suspended() is a viable
> > option? Should we ask on the linux-pm list?

Perhaps +CC linux-pm and Rafael on one of the patches and see if any replies.
> > 
> > If it's ok; I will patch:
> > drivers/iio/adc/ti-ads1100.c
> > drivers/iio/pressure/bmp280-core.c
> > drivers/iio/pressure/icp10100.c  
> 
> Hi Jonathan,
> 
> Did you see my question here?

Indeed not. Wise to poke!

> Just ignore this if you are vacationing...
> 
> /Sean
> 
> 


  reply	other threads:[~2025-08-30 14:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-08 15:57 [PATCH v2 0/5] iio: imu: inv_icm42600: pm_runtime fixes + various changes Sean Nyekjaer
2025-08-08 15:57 ` [PATCH v2 1/5] iio: imu: inv_icm42600: Simplify pm_runtime setup Sean Nyekjaer
2025-08-08 21:37   ` Andy Shevchenko
2025-08-09 18:06     ` Jonathan Cameron
2025-08-09 20:27       ` Andy Shevchenko
2025-08-11 14:21         ` Sean Nyekjaer
2025-08-11 14:24           ` Andy Shevchenko
2025-08-25 15:14           ` Sean Nyekjaer
2025-08-30 14:45             ` Jonathan Cameron [this message]
2025-08-08 15:57 ` [PATCH v2 2/5] iio: imu: inv_icm42600: Drop redundant pm_runtime reinitialization in resume Sean Nyekjaer
2025-08-08 15:57 ` [PATCH v2 3/5] iio: imu: inv_icm42600: Avoid configuring if already pm_runtime suspended Sean Nyekjaer
2025-08-08 15:57 ` [PATCH v2 4/5] iio: imu: inv_icm42600: Use devm_regulator_get_enable() for vdd regulator Sean Nyekjaer
2025-08-08 15:57 ` [PATCH v2 5/5] iio: imu: inv_icm42600: use guard() to release mutexes Sean Nyekjaer
2025-08-08 21:52   ` Andy Shevchenko
2025-08-11 11:47     ` Sean Nyekjaer

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=20250830154559.427969c6@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jean-baptiste.maneyrol@tdk.com \
    --cc=jmaneyrol@invensense.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=sean@geanix.com \
    /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®