iio: light: vcnl4035: remove vcnl4035_set_pm_runtime_state() helper

vcnl4035_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 <ekffu200098@gmail.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
This commit is contained in:
Sang-Heon Jeon 2026-07-28 03:47:42 +09:00 committed by Jonathan Cameron
parent 75056737b6
commit 434291cc8a

View File

@ -145,16 +145,6 @@ static const struct iio_trigger_ops vcnl4035_trigger_ops = {
.set_trigger_state = vcnl4035_als_drdy_set_state,
};
static int vcnl4035_set_pm_runtime_state(struct vcnl4035_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 vcnl4035_read_info_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan, int *val)
{
@ -202,11 +192,11 @@ static int vcnl4035_read_raw(struct iio_dev *indio_dev,
switch (mask) {
case IIO_CHAN_INFO_RAW:
ret = vcnl4035_set_pm_runtime_state(data, true);
ret = pm_runtime_resume_and_get(&data->client->dev);
if (ret < 0)
return ret;
ret = vcnl4035_read_info_raw(indio_dev, chan, val);
vcnl4035_set_pm_runtime_state(data, false);
pm_runtime_put_autosuspend(&data->client->dev);
return ret;
case IIO_CHAN_INFO_INT_TIME:
*val = 50;
@ -237,7 +227,7 @@ static int vcnl4035_write_raw(struct iio_dev *indio_dev,
if (val <= 0 || val > 800)
return -EINVAL;
ret = vcnl4035_set_pm_runtime_state(data, true);
ret = pm_runtime_resume_and_get(&data->client->dev);
if (ret < 0)
return ret;
@ -247,7 +237,7 @@ static int vcnl4035_write_raw(struct iio_dev *indio_dev,
if (!ret)
data->als_it_val = val / 100;
vcnl4035_set_pm_runtime_state(data, false);
pm_runtime_put_autosuspend(&data->client->dev);
return ret;
default:
return -EINVAL;