From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: "Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Eugen Hristev" <eugen.hristev@linaro.org>,
"Nicolas Ferre" <nicolas.ferre@microchip.com>,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
"Claudiu Beznea" <claudiu.beznea@tuxon.dev>,
"Cai Huoqing" <cai.huoqing@linux.dev>,
"Haibo Chen" <haibo.chen@nxp.com>,
"Shawn Guo" <shawnguo@kernel.org>,
"Sascha Hauer" <s.hauer@pengutronix.de>,
"Pengutronix Kernel Team" <kernel@pengutronix.de>,
"Fabio Estevam" <festevam@gmail.com>,
"Marek Vasut" <marek.vasut@gmail.com>,
"Geert Uytterhoeven" <geert+renesas@glider.be>,
"Magnus Damm" <magnus.damm@gmail.com>,
"Lad Prabhakar" <prabhakar.mahadev-lad.rj@bp.renesas.com>,
"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
"Alexandre Torgue" <alexandre.torgue@foss.st.com>,
"Chen-Yu Tsai" <wens@csie.org>,
"Jernej Skrabec" <jernej.skrabec@gmail.com>,
"Samuel Holland" <samuel@sholland.org>,
"Francesco Dolcini" <francesco@dolcini.it>,
"João Paulo Gonçalves" <jpaulo.silvagoncalves@gmail.com>,
"Rui Miguel Silva" <rmfrfs@gmail.com>,
"Jean-Baptiste Maneyrol" <jean-baptiste.maneyrol@tdk.com>,
"Subhajit Ghosh" <subhajit.ghosh@tweaklogic.com>,
"Gerald Loacker" <gerald.loacker@wolfvision.net>,
"Andreas Klinger" <ak@it-klinger.de>,
"Crt Mori" <cmo@melexis.com>,
"Waqar Hameed" <waqar.hameed@axis.com>,
"Julien Stephan" <jstephan@baylibre.com>,
"Peter Zijlstra" <peterz@infradead.org>,
"Sakari Ailus" <sakari.ailus@linux.intel.com>,
"Greg KH" <gregkh@linuxfoundation.org>,
"Bo Liu" <liubo03@inspur.com>,
"Al Viro" <viro@zeniv.linux.org.uk>,
"Sean Nyekjaer" <sean@geanix.com>, "Frank Li" <Frank.Li@nxp.com>,
"Han Xu" <han.xu@nxp.com>, "Rayyan Ansari" <rayyan@ansari.sh>,
"Gustavo Vaz" <gustavo.vaz@usp.br>,
"Matti Vaittinen" <mazziesaccount@gmail.com>,
"Alexandru Ardelean" <aardelean@baylibre.com>,
"Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
"Rob Herring (Arm)" <robh@kernel.org>,
"Fabrice Gasnier" <fabrice.gasnier@foss.st.com>,
"Uwe Kleine-König" <u.kleine-koenig@baylibre.com>,
"Olivier Moysan" <olivier.moysan@foss.st.com>,
"Christophe JAILLET" <christophe.jaillet@wanadoo.fr>,
"Marcelo Schmitt" <marcelo.schmitt1@gmail.com>,
"Vasileios Amoiridis" <vassilisamir@gmail.com>,
"Srinivas Pandruvada" <srinivas.pandruvada@linux.intel.com>,
"Hans de Goede" <hansg@kernel.org>,
"Javier Carrasco" <javier.carrasco.cruz@gmail.com>,
"Abhash Jha" <abhashkumarjha123@gmail.com>,
chuguangqing <chuguangqing@inspur.com>,
"Shreeya Patel" <shreeya.patel@collabora.com>,
"Per-Daniel Olsson" <perdaniel.olsson@axis.com>,
"Barnabás Czémán" <barnabas.czeman@mainlining.org>,
"Neil Armstrong" <neil.armstrong@linaro.org>,
"David Laight" <david.laight@aculab.com>,
"Jakob Hauser" <jahau@rocketmail.com>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev,
linux-renesas-soc@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-sunxi@lists.linux.dev
Subject: [PATCH v3 08/12] iio: light: Remove redundant pm_runtime_mark_last_busy() calls
Date: Mon, 25 Aug 2025 16:53:57 +0300 [thread overview]
Message-ID: <20250825135401.1765847-9-sakari.ailus@linux.intel.com> (raw)
In-Reply-To: <20250825135401.1765847-1-sakari.ailus@linux.intel.com>
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/apds9306.c b/drivers/iio/light/apds9306.c
index 5eb33e8e3ad9..389125675caa 100644
--- a/drivers/iio/light/apds9306.c
+++ b/drivers/iio/light/apds9306.c
@@ -537,7 +537,6 @@ static int apds9306_read_data(struct apds9306_data *data, int *val, int reg)
*val = get_unaligned_le24(&buff);
- pm_runtime_mark_last_busy(data->dev);
pm_runtime_put_autosuspend(data->dev);
return 0;
@@ -1121,7 +1120,6 @@ static int apds9306_write_event_config(struct iio_dev *indio_dev,
if (ret)
return ret;
- pm_runtime_mark_last_busy(data->dev);
pm_runtime_put_autosuspend(data->dev);
return 0;
diff --git a/drivers/iio/light/apds9960.c b/drivers/iio/light/apds9960.c
index b92d0fce5aec..79b202c59a0f 100644
--- a/drivers/iio/light/apds9960.c
+++ b/drivers/iio/light/apds9960.c
@@ -495,7 +495,6 @@ static int apds9960_set_power_state(struct apds9960_data *data, bool on)
usleep_range(data->als_adc_int_us,
APDS9960_MAX_INT_TIME_IN_US);
} else {
- pm_runtime_mark_last_busy(dev);
ret = pm_runtime_put_autosuspend(dev);
}
diff --git a/drivers/iio/light/bh1780.c b/drivers/iio/light/bh1780.c
index c7c877d2fe67..5d3c6d5276ba 100644
--- a/drivers/iio/light/bh1780.c
+++ b/drivers/iio/light/bh1780.c
@@ -111,7 +111,6 @@ static int bh1780_read_raw(struct iio_dev *indio_dev,
value = bh1780_read_word(bh1780, BH1780_REG_DLOW);
if (value < 0)
return value;
- pm_runtime_mark_last_busy(&bh1780->client->dev);
pm_runtime_put_autosuspend(&bh1780->client->dev);
*val = value;
diff --git a/drivers/iio/light/gp2ap002.c b/drivers/iio/light/gp2ap002.c
index 42859e5b1089..a0d8a58f2704 100644
--- a/drivers/iio/light/gp2ap002.c
+++ b/drivers/iio/light/gp2ap002.c
@@ -271,7 +271,6 @@ static int gp2ap002_read_raw(struct iio_dev *indio_dev,
}
out:
- pm_runtime_mark_last_busy(gp2ap002->dev);
pm_runtime_put_autosuspend(gp2ap002->dev);
return ret;
@@ -353,7 +352,6 @@ static int gp2ap002_write_event_config(struct iio_dev *indio_dev,
pm_runtime_get_sync(gp2ap002->dev);
gp2ap002->enabled = true;
} else {
- pm_runtime_mark_last_busy(gp2ap002->dev);
pm_runtime_put_autosuspend(gp2ap002->dev);
gp2ap002->enabled = false;
}
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);
}
/* 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)
return ret;
}
} else {
- pm_runtime_mark_last_busy(dev);
pm_runtime_put_autosuspend(dev);
}
diff --git a/drivers/iio/light/pa12203001.c b/drivers/iio/light/pa12203001.c
index 8885852bef22..98a1f1624c75 100644
--- a/drivers/iio/light/pa12203001.c
+++ b/drivers/iio/light/pa12203001.c
@@ -185,15 +185,10 @@ static int pa12203001_set_power_state(struct pa12203001_data *data, bool on,
mutex_unlock(&data->lock);
}
- if (on) {
- ret = pm_runtime_resume_and_get(&data->client->dev);
+ if (on)
+ return pm_runtime_resume_and_get(&data->client->dev);
- } else {
- pm_runtime_mark_last_busy(&data->client->dev);
- ret = pm_runtime_put_autosuspend(&data->client->dev);
- }
-
- return ret;
+ return pm_runtime_put_autosuspend(&data->client->dev);
err:
mutex_unlock(&data->lock);
diff --git a/drivers/iio/light/rpr0521.c b/drivers/iio/light/rpr0521.c
index fbd116272921..9341c1d58cbe 100644
--- a/drivers/iio/light/rpr0521.c
+++ b/drivers/iio/light/rpr0521.c
@@ -358,12 +358,10 @@ static int rpr0521_set_power_state(struct rpr0521_data *data, bool on,
* Note: If either measurement is re-enabled before _suspend(),
* both stay enabled until _suspend().
*/
- if (on) {
+ if (on)
ret = pm_runtime_resume_and_get(&data->client->dev);
- } else {
- pm_runtime_mark_last_busy(&data->client->dev);
+ else
ret = pm_runtime_put_autosuspend(&data->client->dev);
- }
if (ret < 0) {
dev_err(&data->client->dev,
"Failed: rpr0521_set_power_state for %d, ret %d\n",
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)
{
- 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/tsl2591.c b/drivers/iio/light/tsl2591.c
index 08476f193a44..c5557867ea43 100644
--- a/drivers/iio/light/tsl2591.c
+++ b/drivers/iio/light/tsl2591.c
@@ -772,7 +772,6 @@ static int tsl2591_read_raw(struct iio_dev *indio_dev,
err_unlock:
mutex_unlock(&chip->als_mutex);
- pm_runtime_mark_last_busy(&client->dev);
pm_runtime_put_autosuspend(&client->dev);
return ret;
@@ -995,7 +994,6 @@ static int tsl2591_write_event_config(struct iio_dev *indio_dev,
pm_runtime_get_sync(&client->dev);
} else if (!state && chip->events_enabled) {
chip->events_enabled = false;
- pm_runtime_mark_last_busy(&client->dev);
pm_runtime_put_autosuspend(&client->dev);
}
diff --git a/drivers/iio/light/us5182d.c b/drivers/iio/light/us5182d.c
index 61a0957317a1..d2f5a44892a8 100644
--- a/drivers/iio/light/us5182d.c
+++ b/drivers/iio/light/us5182d.c
@@ -361,19 +361,13 @@ static int us5182d_shutdown_en(struct us5182d_data *data, u8 state)
static int us5182d_set_power_state(struct us5182d_data *data, bool on)
{
- int ret;
-
if (data->power_mode == US5182D_ONESHOT)
return 0;
- if (on) {
- ret = pm_runtime_resume_and_get(&data->client->dev);
- } else {
- pm_runtime_mark_last_busy(&data->client->dev);
- ret = pm_runtime_put_autosuspend(&data->client->dev);
- }
+ if (on)
+ return pm_runtime_resume_and_get(&data->client->dev);
- return ret;
+ return pm_runtime_put_autosuspend(&data->client->dev);
}
static int us5182d_read_value(struct us5182d_data *data,
diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c
index cc81a30b7c70..4dbb2294a843 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)
{
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 = {
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,
--
2.47.2
next prev parent reply other threads:[~2025-08-25 13:54 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-25 13:53 [PATCH v3 00/12] iio: Remove redundant pm_runtime_mark_last_busy() calls Sakari Ailus
2025-08-25 13:53 ` [PATCH v3 01/12] iio: accel: " Sakari Ailus
2025-08-25 15:01 ` Jonathan Cameron
2025-08-25 13:53 ` [PATCH v3 02/12] iio: adc: " Sakari Ailus
2025-08-25 15:02 ` Jonathan Cameron
2025-08-25 13:53 ` [PATCH v3 03/12] iio: chemical: " Sakari Ailus
2025-08-25 15:03 ` Jonathan Cameron
2025-08-25 13:53 ` [PATCH v3 04/12] iio: common: " Sakari Ailus
2025-08-25 15:03 ` Jonathan Cameron
2025-08-25 13:53 ` [PATCH v3 05/12] iio: dac: " Sakari Ailus
2025-08-25 15:00 ` Jonathan Cameron
2025-08-25 20:27 ` Sakari Ailus
2025-08-25 13:53 ` [PATCH v3 06/12] iio: gyro: " Sakari Ailus
2025-08-25 15:05 ` Jonathan Cameron
2025-08-25 13:53 ` [PATCH v3 07/12] iio: imu: " Sakari Ailus
2025-08-25 15:06 ` Jonathan Cameron
2025-08-25 13:53 ` Sakari Ailus [this message]
2025-08-25 15:13 ` [PATCH v3 08/12] iio: light: " Jonathan Cameron
2025-08-25 13:53 ` [PATCH v3 09/12] iio: magnetometer: " Sakari Ailus
2025-08-25 15:15 ` Jonathan Cameron
2025-08-25 13:53 ` [PATCH v3 10/12] iio: pressure: " Sakari Ailus
2025-08-25 15:16 ` Jonathan Cameron
2025-08-25 13:54 ` [PATCH v3 11/12] iio: proximity: " Sakari Ailus
2025-08-25 15:17 ` Jonathan Cameron
2025-08-25 13:54 ` [PATCH v3 12/12] iio: temperature: " Sakari Ailus
2025-08-25 15:18 ` 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=20250825135401.1765847-9-sakari.ailus@linux.intel.com \
--to=sakari.ailus@linux.intel.com \
--cc=Frank.Li@nxp.com \
--cc=aardelean@baylibre.com \
--cc=abhashkumarjha123@gmail.com \
--cc=ak@it-klinger.de \
--cc=alexandre.belloni@bootlin.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andy@kernel.org \
--cc=barnabas.czeman@mainlining.org \
--cc=cai.huoqing@linux.dev \
--cc=christophe.jaillet@wanadoo.fr \
--cc=chuguangqing@inspur.com \
--cc=claudiu.beznea@tuxon.dev \
--cc=cmo@melexis.com \
--cc=david.laight@aculab.com \
--cc=dlechner@baylibre.com \
--cc=eugen.hristev@linaro.org \
--cc=fabrice.gasnier@foss.st.com \
--cc=festevam@gmail.com \
--cc=francesco@dolcini.it \
--cc=geert+renesas@glider.be \
--cc=gerald.loacker@wolfvision.net \
--cc=gregkh@linuxfoundation.org \
--cc=gustavo.vaz@usp.br \
--cc=haibo.chen@nxp.com \
--cc=han.xu@nxp.com \
--cc=hansg@kernel.org \
--cc=imx@lists.linux.dev \
--cc=jahau@rocketmail.com \
--cc=javier.carrasco.cruz@gmail.com \
--cc=jean-baptiste.maneyrol@tdk.com \
--cc=jernej.skrabec@gmail.com \
--cc=jic23@kernel.org \
--cc=jirislaby@kernel.org \
--cc=jpaulo.silvagoncalves@gmail.com \
--cc=jstephan@baylibre.com \
--cc=kernel@pengutronix.de \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=linux-sunxi@lists.linux.dev \
--cc=liubo03@inspur.com \
--cc=magnus.damm@gmail.com \
--cc=marcelo.schmitt1@gmail.com \
--cc=marek.vasut@gmail.com \
--cc=mazziesaccount@gmail.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=neil.armstrong@linaro.org \
--cc=nicolas.ferre@microchip.com \
--cc=nuno.sa@analog.com \
--cc=olivier.moysan@foss.st.com \
--cc=perdaniel.olsson@axis.com \
--cc=peterz@infradead.org \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=rayyan@ansari.sh \
--cc=rmfrfs@gmail.com \
--cc=robh@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=samuel@sholland.org \
--cc=sean@geanix.com \
--cc=shawnguo@kernel.org \
--cc=shreeya.patel@collabora.com \
--cc=srinivas.pandruvada@linux.intel.com \
--cc=subhajit.ghosh@tweaklogic.com \
--cc=u.kleine-koenig@baylibre.com \
--cc=vassilisamir@gmail.com \
--cc=viro@zeniv.linux.org.uk \
--cc=waqar.hameed@axis.com \
--cc=wens@csie.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