[PATCH 6/9] iio: light: vcnl4000: remove vcnl4000_set_pm_runtime_state() helper

Sang-Heon Jeon <[email protected]>
Newsgroups org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
vcnl4000_set_pm_runtime_state() 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.

Signed-off-by: Sang-Heon Jeon <[email protected]>
---
 drivers/iio/light/vcnl4000.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c
index b8ac156ad5c9..336468d59ea7 100644
--- a/drivers/iio/light/vcnl4000.c
+++ b/drivers/iio/light/vcnl4000.c
@@ -537,16 +537,6 @@ static bool vcnl4010_is_in_periodic_mode(struct vcnl4000_data *data)
 	return !!(ret & VCNL4000_SELF_TIMED_EN);
 }
 
-static int vcnl4000_set_pm_runtime_state(struct vcnl4000_data *data, bool on)
-{
-	struct device *dev = &data->client->dev;
-
-	if (on)
-		return pm_runtime_resume_and_get(dev);
-
-	return pm_runtime_put_autosuspend(dev);
-}
-
 static int vcnl4040_read_als_it(struct vcnl4000_data *data, int *val, int *val2)
 {
 	int ret;
@@ -850,7 +840,7 @@ static int vcnl4000_read_raw(struct iio_dev *indio_dev,
 
 	switch (mask) {
 	case IIO_CHAN_INFO_RAW:
-		ret = vcnl4000_set_pm_runtime_state(data, true);
+		ret = pm_runtime_resume_and_get(&data->client->dev);
 		if  (ret < 0)
 			return ret;
 
@@ -869,7 +859,7 @@ static int vcnl4000_read_raw(struct iio_dev *indio_dev,
 		default:
 			ret = -EINVAL;
 		}
-		vcnl4000_set_pm_runtime_state(data, false);
+		pm_runtime_put_autosuspend(&data->client->dev);
 		return ret;
 	case IIO_CHAN_INFO_SCALE:
 		if (chan->type != IIO_LIGHT)
-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.