From: Sang-Heon Jeon <ekffu200098@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: "Andy Shevchenko" <andy@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Geert Uytterhoeven" <geert+renesas@glider.be>,
"Linus Walleij" <linusw@kernel.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
"Magnus Damm" <magnus.damm@gmail.com>,
"Marek Vasut" <marek.vasut+renesas@mailbox.org>,
"Nuno Sá" <nuno.sa@analog.com>
Subject: [PATCH 4/9] iio: light: tsl2583: remove tsl2583_set_pm_runtime_busy() helper
Date: Tue, 28 Jul 2026 03:47:41 +0900 [thread overview]
Message-ID: <20260727184755.2055414-5-ekffu200098@gmail.com> (raw)
In-Reply-To: <20260727184755.2055414-1-ekffu200098@gmail.com>
tsl2583_set_pm_runtime_busy() just calls pm_runtime_resume_and_get()
or pm_runtime_put_autosuspend() depending on its bool argument. Call
them directly and remove the helper.
No functional change.
Suggested-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
---
drivers/iio/light/tsl2583.c | 22 +++++++---------------
1 file changed, 7 insertions(+), 15 deletions(-)
diff --git a/drivers/iio/light/tsl2583.c b/drivers/iio/light/tsl2583.c
index 54fa426c5755..06da145569f7 100644
--- a/drivers/iio/light/tsl2583.c
+++ b/drivers/iio/light/tsl2583.c
@@ -639,14 +639,6 @@ static const struct iio_chan_spec tsl2583_channels[] = {
},
};
-static int tsl2583_set_pm_runtime_busy(struct tsl2583_chip *chip, bool on)
-{
- if (on)
- return pm_runtime_resume_and_get(&chip->client->dev);
-
- return pm_runtime_put_autosuspend(&chip->client->dev);
-}
-
static int tsl2583_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val, int *val2, long mask)
@@ -654,7 +646,7 @@ static int tsl2583_read_raw(struct iio_dev *indio_dev,
struct tsl2583_chip *chip = iio_priv(indio_dev);
int ret, pm_ret;
- ret = tsl2583_set_pm_runtime_busy(chip, true);
+ ret = pm_runtime_resume_and_get(&chip->client->dev);
if (ret < 0)
return ret;
@@ -722,16 +714,16 @@ static int tsl2583_read_raw(struct iio_dev *indio_dev,
mutex_unlock(&chip->als_mutex);
if (ret < 0) {
- tsl2583_set_pm_runtime_busy(chip, false);
+ pm_runtime_put_autosuspend(&chip->client->dev);
return ret;
}
/*
* Preserve the ret variable if the call to
- * tsl2583_set_pm_runtime_busy() is successful so the reading
+ * pm_runtime_put_autosuspend() is successful so the reading
* (if applicable) is returned to user space.
*/
- pm_ret = tsl2583_set_pm_runtime_busy(chip, false);
+ pm_ret = pm_runtime_put_autosuspend(&chip->client->dev);
if (pm_ret < 0)
return pm_ret;
@@ -745,7 +737,7 @@ static int tsl2583_write_raw(struct iio_dev *indio_dev,
struct tsl2583_chip *chip = iio_priv(indio_dev);
int ret;
- ret = tsl2583_set_pm_runtime_busy(chip, true);
+ ret = pm_runtime_resume_and_get(&chip->client->dev);
if (ret < 0)
return ret;
@@ -786,11 +778,11 @@ static int tsl2583_write_raw(struct iio_dev *indio_dev,
mutex_unlock(&chip->als_mutex);
if (ret < 0) {
- tsl2583_set_pm_runtime_busy(chip, false);
+ pm_runtime_put_autosuspend(&chip->client->dev);
return ret;
}
- ret = tsl2583_set_pm_runtime_busy(chip, false);
+ ret = pm_runtime_put_autosuspend(&chip->client->dev);
if (ret < 0)
return ret;
--
2.43.0
next prev parent reply other threads:[~2026-07-27 18:49 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 18:47 [PATCH 0/9] iio: fix write_raw() return values and remove pm helpers Sang-Heon Jeon
2026-07-27 18:47 ` [PATCH 1/9] iio: light: isl29028: return zero in write_raw() on success Sang-Heon Jeon
2026-07-28 19:54 ` Brian Masney
2026-07-27 18:47 ` [PATCH 2/9] iio: light: tsl2583: " Sang-Heon Jeon
2026-07-28 19:55 ` Brian Masney
2026-07-27 18:47 ` [PATCH 3/9] iio: light: isl29028: remove isl29028_set_pm_runtime_busy() helper Sang-Heon Jeon
2026-07-28 19:57 ` Brian Masney
2026-07-27 18:47 ` Sang-Heon Jeon [this message]
2026-07-28 19:58 ` [PATCH 4/9] iio: light: tsl2583: remove tsl2583_set_pm_runtime_busy() helper Brian Masney
2026-07-27 18:47 ` [PATCH 5/9] iio: light: vcnl4035: remove vcnl4035_set_pm_runtime_state() helper Sang-Heon Jeon
2026-07-27 18:47 ` [PATCH 6/9] iio: light: vcnl4000: remove vcnl4000_set_pm_runtime_state() helper Sang-Heon Jeon
2026-07-27 18:47 ` [PATCH 7/9] iio: adc: rcar-gyroadc: remove rcar_gyroadc_set_power() helper Sang-Heon Jeon
2026-07-27 18:47 ` [PATCH 8/9] iio: light: tsl2583: remove conditional return with no effect Sang-Heon Jeon
2026-07-28 19:59 ` Brian Masney
2026-07-27 18:47 ` [PATCH 9/9] iio: magnetometer: ak8974: " Sang-Heon Jeon
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=20260727184755.2055414-5-ekffu200098@gmail.com \
--to=ekffu200098@gmail.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=geert+renesas@glider.be \
--cc=jic23@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=marek.vasut+renesas@mailbox.org \
--cc=nuno.sa@analog.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