]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iio: magnetometer: Remove redundant pm_runtime_mark_last_busy() calls
authorSakari Ailus <sakari.ailus@linux.intel.com>
Mon, 25 Aug 2025 13:53:58 +0000 (16:53 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 25 Aug 2025 15:16:02 +0000 (16:16 +0100)
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>
Link: https://patch.msgid.link/20250825135401.1765847-10-sakari.ailus@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/magnetometer/ak8974.c
drivers/iio/magnetometer/ak8975.c
drivers/iio/magnetometer/als31300.c
drivers/iio/magnetometer/bmc150_magn.c
drivers/iio/magnetometer/tmag5273.c
drivers/iio/magnetometer/yamaha-yas530.c

index 947fe8a475f28817a1972db6498aa7258d5cad60..68ece700c7ce2da8f5b2fb0da200226959a79461 100644 (file)
@@ -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);
 }
 
index a1e92b2abffdddb4b79a1b03594e4b2167cdac9d..3fd0171e5d69b6fe98e63df599f4fe311af6be52 100644 (file)
@@ -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. */
index 928e1378304c9eb9cad320056f78bb39397a834f..c083bef5357399f1d0b75fab261a327f3dbca4c3 100644 (file)
@@ -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);
index 761daead5ada5c04d250668e4a92149b1a576905..6a73f6e2f1f069837fbf69b66c0a8a6768e691b0 100644 (file)
@@ -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;
 }
index bdb656b031b1c34102d29f3eba905862ea595b87..bd3c50157843489a03e7bd0edbf15c0fac449d40 100644 (file)
@@ -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);
index 340607111d9ad8b9258b7fd416a232f386f157b8..d49e37edcbeda8526ce82bc65386d3808fd71216 100644 (file)
@@ -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");