From: Jonathan Cameron <jic23@kernel.org>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: "Subhajit Ghosh" <subhajit.ghosh@tweaklogic.com>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Julien Stephan" <jstephan@baylibre.com>,
"Abhash Jha" <abhashkumarjha123@gmail.com>,
"Waqar Hameed" <waqar.hameed@axis.com>,
chuguangqing <chuguangqing@inspur.com>,
"Shreeya Patel" <shreeya.patel@collabora.com>,
"Marek Vasut" <marex@denx.de>,
"Al Viro" <viro@zeniv.linux.org.uk>,
"Vasileios Amoiridis" <vassilisamir@gmail.com>,
"Per-Daniel Olsson" <perdaniel.olsson@axis.com>,
"Javier Carrasco" <javier.carrasco.cruz@gmail.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 08/12] iio: light: Remove redundant pm_runtime_mark_last_busy() calls
Date: Wed, 9 Jul 2025 16:45:45 +0100 [thread overview]
Message-ID: <20250709164545.3af9f056@jic23-huawei> (raw)
In-Reply-To: <20250708231152.971728-1-sakari.ailus@linux.intel.com>
On Wed, 9 Jul 2025 02:11:52 +0300
Sakari Ailus <sakari.ailus@linux.intel.com> wrote:
> pm_runtime_put_autosuspend(), pm_runtime_put_sync_autosuspend(),
> pm_runtime_autosuspend() and pm_request_autosuspend() now include a call
> to pm_runtime_mark_last_busy(). Remove the now-reduntant explicit call to
> pm_runtime_mark_last_busy().
>
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> drivers/iio/light/apds9306.c | 2 --
> drivers/iio/light/apds9960.c | 1 -
> drivers/iio/light/bh1780.c | 1 -
> drivers/iio/light/gp2ap002.c | 2 --
> drivers/iio/light/isl29028.c | 11 +++--------
> drivers/iio/light/ltrf216a.c | 1 -
> drivers/iio/light/pa12203001.c | 11 +++--------
> drivers/iio/light/rpr0521.c | 6 ++----
> drivers/iio/light/tsl2583.c | 12 +++---------
> drivers/iio/light/tsl2591.c | 2 --
> drivers/iio/light/us5182d.c | 12 +++---------
> drivers/iio/light/vcnl4000.c | 11 +++--------
> drivers/iio/light/vcnl4035.c | 11 +++--------
> 13 files changed, 20 insertions(+), 63 deletions(-)
>
> diff --git a/drivers/iio/light/isl29028.c b/drivers/iio/light/isl29028.c
> index 0e4284823d44..374bccad9119 100644
> --- a/drivers/iio/light/isl29028.c
> +++ b/drivers/iio/light/isl29028.c
> @@ -336,16 +336,11 @@ static int isl29028_ir_get(struct isl29028_chip *chip, int *ir_data)
> static int isl29028_set_pm_runtime_busy(struct isl29028_chip *chip, bool on)
> {
> struct device *dev = regmap_get_device(chip->regmap);
> - int ret;
>
> - if (on) {
> - ret = pm_runtime_resume_and_get(dev);
> - } else {
> - pm_runtime_mark_last_busy(dev);
> - ret = pm_runtime_put_autosuspend(dev);
> - }
> + if (on)
> + return pm_runtime_resume_and_get(dev);
>
> - return ret;
> + return pm_runtime_put_autosuspend(dev);
> }
This is one that can definitely be squashed down to call sites given
the parameter is always hard coded.
>
> /* Channel IO */
> diff --git a/drivers/iio/light/ltrf216a.c b/drivers/iio/light/ltrf216a.c
> index 61f57a82b872..5f27f754fe1c 100644
> --- a/drivers/iio/light/ltrf216a.c
> +++ b/drivers/iio/light/ltrf216a.c
> @@ -208,7 +208,6 @@ static int ltrf216a_set_power_state(struct ltrf216a_data *data, bool on)
Also this one.
> return ret;
> }
> } else {
> - pm_runtime_mark_last_busy(dev);
> pm_runtime_put_autosuspend(dev);
> }
>
> diff --git a/drivers/iio/light/tsl2583.c b/drivers/iio/light/tsl2583.c
> index fc3b0c4226be..8801a491de77 100644
> --- a/drivers/iio/light/tsl2583.c
> +++ b/drivers/iio/light/tsl2583.c
> @@ -641,16 +641,10 @@ static const struct iio_chan_spec tsl2583_channels[] = {
>
> static int tsl2583_set_pm_runtime_busy(struct tsl2583_chip *chip, bool on)
And this one.
> {
> - int ret;
> + if (on)
> + return pm_runtime_resume_and_get(&chip->client->dev);
>
> - if (on) {
> - ret = pm_runtime_resume_and_get(&chip->client->dev);
> - } else {
> - pm_runtime_mark_last_busy(&chip->client->dev);
> - ret = pm_runtime_put_autosuspend(&chip->client->dev);
> - }
> -
> - return ret;
> + return pm_runtime_put_autosuspend(&chip->client->dev);
> }
>
> static int tsl2583_read_raw(struct iio_dev *indio_dev,
> diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c
> index 90e7d4421abf..7d70bb71b432 100644
> --- a/drivers/iio/light/vcnl4000.c
> +++ b/drivers/iio/light/vcnl4000.c
> @@ -576,16 +576,11 @@ static bool vcnl4010_is_in_periodic_mode(struct vcnl4000_data *data)
> static int vcnl4000_set_pm_runtime_state(struct vcnl4000_data *data, bool on)
And this one.
> {
> struct device *dev = &data->client->dev;
> - int ret;
>
> - if (on) {
> - ret = pm_runtime_resume_and_get(dev);
> - } else {
> - pm_runtime_mark_last_busy(dev);
> - ret = pm_runtime_put_autosuspend(dev);
> - }
> + if (on)
> + return pm_runtime_resume_and_get(dev);
>
> - return ret;
> + return pm_runtime_put_autosuspend(dev);
> }
>
> static int vcnl4040_read_als_it(struct vcnl4000_data *data, int *val, int *val2)
> diff --git a/drivers/iio/light/vcnl4035.c b/drivers/iio/light/vcnl4035.c
> index 01bc99564f98..963747927425 100644
> --- a/drivers/iio/light/vcnl4035.c
> +++ b/drivers/iio/light/vcnl4035.c
> @@ -141,17 +141,12 @@ static const struct iio_trigger_ops vcnl4035_trigger_ops = {
And this one. All as follow up series though to keep this series focused
on just the dropping of the calls.
>
> static int vcnl4035_set_pm_runtime_state(struct vcnl4035_data *data, bool on)
> {
> - int ret;
> struct device *dev = &data->client->dev;
>
> - if (on) {
> - ret = pm_runtime_resume_and_get(dev);
> - } else {
> - pm_runtime_mark_last_busy(dev);
> - ret = pm_runtime_put_autosuspend(dev);
> - }
> + if (on)
> + return pm_runtime_resume_and_get(dev);
>
> - return ret;
> + return pm_runtime_put_autosuspend(dev);
> }
>
> static int vcnl4035_read_info_raw(struct iio_dev *indio_dev,
next prev parent reply other threads:[~2025-07-09 15:45 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-08 23:11 [PATCH v2 00/12] iio: Remove redundant pm_runtime_mark_last_busy() calls Sakari Ailus
2025-07-08 23:11 ` [PATCH v2 01/12] iio: accel: " Sakari Ailus
2025-07-09 8:46 ` Andy Shevchenko
2025-07-09 15:28 ` Jonathan Cameron
2025-07-08 23:11 ` [PATCH v2 07/12] iio: imu: " Sakari Ailus
2025-07-08 23:11 ` [PATCH v2 08/12] iio: light: " Sakari Ailus
2025-07-09 15:45 ` Jonathan Cameron [this message]
2025-07-08 23:11 ` [PATCH v2 06/12] iio: gyro: " Sakari Ailus
2025-07-09 8:51 ` Andy Shevchenko
2025-07-09 15:51 ` Jonathan Cameron
2025-07-08 23:11 ` [PATCH v2 05/12] iio: dac: " Sakari Ailus
2025-07-09 8:48 ` Andy Shevchenko
2025-07-09 15:49 ` Jonathan Cameron
2025-07-08 23:11 ` [PATCH v2 04/12] iio: common: " Sakari Ailus
2025-07-08 23:11 ` [PATCH v2 03/12] iio: chemical: " Sakari Ailus
2025-07-08 23:11 ` [PATCH v2 09/12] iio: magnetometer: " Sakari Ailus
2025-07-09 15:47 ` Jonathan Cameron
2025-07-08 23:11 ` [PATCH v2 02/12] iio: adc: " Sakari Ailus
2025-07-09 3:52 ` Chen-Yu Tsai
2025-07-09 15:37 ` Jonathan Cameron
2025-08-25 11:57 ` Sakari Ailus
2025-07-08 23:11 ` [PATCH v2 10/12] iio: pressure: " Sakari Ailus
2025-07-08 23:11 ` [PATCH v2 12/12] iio: temperature: " Sakari Ailus
2025-07-08 23:11 ` [PATCH v2 11/12] iio: proximity: " Sakari Ailus
2025-07-09 15:55 ` [PATCH v2 00/12] iio: " Jonathan Cameron
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=20250709164545.3af9f056@jic23-huawei \
--to=jic23@kernel.org \
--cc=abhashkumarjha123@gmail.com \
--cc=andy@kernel.org \
--cc=chuguangqing@inspur.com \
--cc=dlechner@baylibre.com \
--cc=javier.carrasco.cruz@gmail.com \
--cc=jstephan@baylibre.com \
--cc=linus.walleij@linaro.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marex@denx.de \
--cc=nuno.sa@analog.com \
--cc=perdaniel.olsson@axis.com \
--cc=sakari.ailus@linux.intel.com \
--cc=shreeya.patel@collabora.com \
--cc=subhajit.ghosh@tweaklogic.com \
--cc=vassilisamir@gmail.com \
--cc=viro@zeniv.linux.org.uk \
--cc=waqar.hameed@axis.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