ARM Sunxi Platform Development
 help / color / mirror / Atom feed
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 09/12] iio: magnetometer: Remove redundant pm_runtime_mark_last_busy() calls
Date: Mon, 25 Aug 2025 16:53:58 +0300	[thread overview]
Message-ID: <20250825135401.1765847-10-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().

Also drop checking for errors on pm_runtime_put_autosuspend() in
bmc150_magn_set_power_state().

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/iio/magnetometer/ak8974.c        |  2 --
 drivers/iio/magnetometer/ak8975.c        |  1 -
 drivers/iio/magnetometer/als31300.c      |  2 --
 drivers/iio/magnetometer/bmc150_magn.c   | 13 ++++---------
 drivers/iio/magnetometer/tmag5273.c      |  2 --
 drivers/iio/magnetometer/yamaha-yas530.c |  2 --
 6 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/drivers/iio/magnetometer/ak8974.c b/drivers/iio/magnetometer/ak8974.c
index 947fe8a475f2..68ece700c7ce 100644
--- a/drivers/iio/magnetometer/ak8974.c
+++ b/drivers/iio/magnetometer/ak8974.c
@@ -583,7 +583,6 @@ static int ak8974_measure_channel(struct ak8974 *ak8974, unsigned long address,
 	*val = (s16)le16_to_cpu(hw_values[address]);
 out_unlock:
 	mutex_unlock(&ak8974->lock);
-	pm_runtime_mark_last_busy(&ak8974->i2c->dev);
 	pm_runtime_put_autosuspend(&ak8974->i2c->dev);
 
 	return ret;
@@ -678,7 +677,6 @@ static void ak8974_fill_buffer(struct iio_dev *indio_dev)
 
  out_unlock:
 	mutex_unlock(&ak8974->lock);
-	pm_runtime_mark_last_busy(&ak8974->i2c->dev);
 	pm_runtime_put_autosuspend(&ak8974->i2c->dev);
 }
 
diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c
index a1e92b2abffd..3fd0171e5d69 100644
--- a/drivers/iio/magnetometer/ak8975.c
+++ b/drivers/iio/magnetometer/ak8975.c
@@ -775,7 +775,6 @@ static int ak8975_read_axis(struct iio_dev *indio_dev, int index, int *val)
 
 	mutex_unlock(&data->lock);
 
-	pm_runtime_mark_last_busy(&data->client->dev);
 	pm_runtime_put_autosuspend(&data->client->dev);
 
 	/* Swap bytes and convert to valid range. */
diff --git a/drivers/iio/magnetometer/als31300.c b/drivers/iio/magnetometer/als31300.c
index 928e1378304c..c083bef53573 100644
--- a/drivers/iio/magnetometer/als31300.c
+++ b/drivers/iio/magnetometer/als31300.c
@@ -140,7 +140,6 @@ static int als31300_get_measure(struct als31300_data *data,
 	*z = ALS31300_DATA_Z_GET(buf);
 
 out:
-	pm_runtime_mark_last_busy(data->dev);
 	pm_runtime_put_autosuspend(data->dev);
 
 	return ret;
@@ -401,7 +400,6 @@ static int als31300_probe(struct i2c_client *i2c)
 	pm_runtime_set_autosuspend_delay(dev, 200);
 	pm_runtime_use_autosuspend(dev);
 
-	pm_runtime_mark_last_busy(dev);
 	pm_runtime_put_autosuspend(dev);
 
 	ret = devm_iio_device_register(dev, indio_dev);
diff --git a/drivers/iio/magnetometer/bmc150_magn.c b/drivers/iio/magnetometer/bmc150_magn.c
index 761daead5ada..6a73f6e2f1f0 100644
--- a/drivers/iio/magnetometer/bmc150_magn.c
+++ b/drivers/iio/magnetometer/bmc150_magn.c
@@ -257,22 +257,17 @@ static int bmc150_magn_set_power_mode(struct bmc150_magn_data *data,
 
 static int bmc150_magn_set_power_state(struct bmc150_magn_data *data, bool on)
 {
-#ifdef CONFIG_PM
-	int ret;
+	int ret = 0;
 
-	if (on) {
+	if (on)
 		ret = pm_runtime_resume_and_get(data->dev);
-	} else {
-		pm_runtime_mark_last_busy(data->dev);
-		ret = pm_runtime_put_autosuspend(data->dev);
-	}
-
+	else
+		pm_runtime_put_autosuspend(data->dev);
 	if (ret < 0) {
 		dev_err(data->dev,
 			"failed to change power state to %d\n", on);
 		return ret;
 	}
-#endif
 
 	return 0;
 }
diff --git a/drivers/iio/magnetometer/tmag5273.c b/drivers/iio/magnetometer/tmag5273.c
index bdb656b031b1..bd3c50157843 100644
--- a/drivers/iio/magnetometer/tmag5273.c
+++ b/drivers/iio/magnetometer/tmag5273.c
@@ -295,7 +295,6 @@ static int tmag5273_read_raw(struct iio_dev *indio_dev,
 
 		ret = tmag5273_get_measure(data, &t, &x, &y, &z, &angle, &magnitude);
 
-		pm_runtime_mark_last_busy(data->dev);
 		pm_runtime_put_autosuspend(data->dev);
 
 		if (ret)
@@ -668,7 +667,6 @@ static int tmag5273_probe(struct i2c_client *i2c)
 	indio_dev->channels = tmag5273_channels;
 	indio_dev->num_channels = ARRAY_SIZE(tmag5273_channels);
 
-	pm_runtime_mark_last_busy(dev);
 	pm_runtime_put_autosuspend(dev);
 
 	ret = devm_iio_device_register(dev, indio_dev);
diff --git a/drivers/iio/magnetometer/yamaha-yas530.c b/drivers/iio/magnetometer/yamaha-yas530.c
index 340607111d9a..d49e37edcbed 100644
--- a/drivers/iio/magnetometer/yamaha-yas530.c
+++ b/drivers/iio/magnetometer/yamaha-yas530.c
@@ -623,7 +623,6 @@ static int yas5xx_read_raw(struct iio_dev *indio_dev,
 	case IIO_CHAN_INFO_RAW:
 		pm_runtime_get_sync(yas5xx->dev);
 		ret = ci->get_measure(yas5xx, &t, &x, &y, &z);
-		pm_runtime_mark_last_busy(yas5xx->dev);
 		pm_runtime_put_autosuspend(yas5xx->dev);
 		if (ret)
 			return ret;
@@ -664,7 +663,6 @@ static void yas5xx_fill_buffer(struct iio_dev *indio_dev)
 
 	pm_runtime_get_sync(yas5xx->dev);
 	ret = ci->get_measure(yas5xx, &t, &x, &y, &z);
-	pm_runtime_mark_last_busy(yas5xx->dev);
 	pm_runtime_put_autosuspend(yas5xx->dev);
 	if (ret) {
 		dev_err(yas5xx->dev, "error refilling buffer\n");
-- 
2.47.2


  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 ` [PATCH v3 08/12] iio: light: " Sakari Ailus
2025-08-25 15:13   ` Jonathan Cameron
2025-08-25 13:53 ` Sakari Ailus [this message]
2025-08-25 15:15   ` [PATCH v3 09/12] iio: magnetometer: " 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-10-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