iio: adc: rcar-gyroadc: remove rcar_gyroadc_set_power() helper

rcar_gyroadc_set_power() 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:44 +09:00 committed by Jonathan Cameron
parent 9bd7d3ea05
commit 14ba50c036

View File

@ -159,16 +159,6 @@ static const struct iio_chan_spec rcar_gyroadc_iio_channels_3[] = {
RCAR_GYROADC_CHAN(7),
};
static int rcar_gyroadc_set_power(struct rcar_gyroadc *priv, bool on)
{
struct device *dev = priv->dev;
if (on)
return pm_runtime_resume_and_get(dev);
return pm_runtime_put_autosuspend(dev);
}
static int rcar_gyroadc_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val, int *val2, long mask)
@ -200,7 +190,7 @@ static int rcar_gyroadc_read_raw(struct iio_dev *indio_dev,
if (!iio_device_claim_direct(indio_dev))
return -EBUSY;
ret = rcar_gyroadc_set_power(priv, true);
ret = pm_runtime_resume_and_get(priv->dev);
if (ret < 0) {
iio_device_release_direct(indio_dev);
return ret;
@ -209,7 +199,7 @@ static int rcar_gyroadc_read_raw(struct iio_dev *indio_dev,
*val = readl(priv->regs + datareg);
*val &= BIT(priv->sample_width) - 1;
ret = rcar_gyroadc_set_power(priv, false);
ret = pm_runtime_put_autosuspend(priv->dev);
iio_device_release_direct(indio_dev);
if (ret < 0)
return ret;