]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iio: light: Remove redundant pm_runtime_mark_last_busy() calls
authorSakari Ailus <sakari.ailus@linux.intel.com>
Mon, 25 Aug 2025 13:53:57 +0000 (16:53 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 25 Aug 2025 15:13:25 +0000 (16:13 +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().

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-9-sakari.ailus@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
13 files changed:
drivers/iio/light/apds9306.c
drivers/iio/light/apds9960.c
drivers/iio/light/bh1780.c
drivers/iio/light/gp2ap002.c
drivers/iio/light/isl29028.c
drivers/iio/light/ltrf216a.c
drivers/iio/light/pa12203001.c
drivers/iio/light/rpr0521.c
drivers/iio/light/tsl2583.c
drivers/iio/light/tsl2591.c
drivers/iio/light/us5182d.c
drivers/iio/light/vcnl4000.c
drivers/iio/light/vcnl4035.c

index 5eb33e8e3ad991a54ccf9b9b14db168d3fcae832..389125675caa4edcc2dcd31a4b4615f119ec7e6e 100644 (file)
@@ -537,7 +537,6 @@ static int apds9306_read_data(struct apds9306_data *data, int *val, int reg)
 
        *val = get_unaligned_le24(&buff);
 
-       pm_runtime_mark_last_busy(data->dev);
        pm_runtime_put_autosuspend(data->dev);
 
        return 0;
@@ -1121,7 +1120,6 @@ static int apds9306_write_event_config(struct iio_dev *indio_dev,
                        if (ret)
                                return ret;
 
-                       pm_runtime_mark_last_busy(data->dev);
                        pm_runtime_put_autosuspend(data->dev);
 
                        return 0;
index b92d0fce5aec620e1404a12e43676f0cc9c3d1f0..79b202c59a0f1a36b036c988823fe13acdda5876 100644 (file)
@@ -495,7 +495,6 @@ static int apds9960_set_power_state(struct apds9960_data *data, bool on)
                        usleep_range(data->als_adc_int_us,
                                     APDS9960_MAX_INT_TIME_IN_US);
        } else {
-               pm_runtime_mark_last_busy(dev);
                ret = pm_runtime_put_autosuspend(dev);
        }
 
index c7c877d2fe67f7391207c860e844bb8184d96bf8..5d3c6d5276bac64152bca317f57e5a01d7fd93bd 100644 (file)
@@ -111,7 +111,6 @@ static int bh1780_read_raw(struct iio_dev *indio_dev,
                        value = bh1780_read_word(bh1780, BH1780_REG_DLOW);
                        if (value < 0)
                                return value;
-                       pm_runtime_mark_last_busy(&bh1780->client->dev);
                        pm_runtime_put_autosuspend(&bh1780->client->dev);
                        *val = value;
 
index 42859e5b1089daf97bbb793e43fc8844ca10301a..a0d8a58f2704253afe90e09f8b483044d733d44d 100644 (file)
@@ -271,7 +271,6 @@ static int gp2ap002_read_raw(struct iio_dev *indio_dev,
        }
 
 out:
-       pm_runtime_mark_last_busy(gp2ap002->dev);
        pm_runtime_put_autosuspend(gp2ap002->dev);
 
        return ret;
@@ -353,7 +352,6 @@ static int gp2ap002_write_event_config(struct iio_dev *indio_dev,
                pm_runtime_get_sync(gp2ap002->dev);
                gp2ap002->enabled = true;
        } else {
-               pm_runtime_mark_last_busy(gp2ap002->dev);
                pm_runtime_put_autosuspend(gp2ap002->dev);
                gp2ap002->enabled = false;
        }
index 0e4284823d4444e394ac6af1c338ca05179dd35f..374bccad9119a4ca49afddfc8360a3164ca41c8d 100644 (file)
@@ -336,16 +336,11 @@ static int isl29028_ir_get(struct isl29028_chip *chip, int *ir_data)
 static int isl29028_set_pm_runtime_busy(struct isl29028_chip *chip, bool on)
 {
        struct device *dev = regmap_get_device(chip->regmap);
-       int ret;
 
-       if (on) {
-               ret = pm_runtime_resume_and_get(dev);
-       } else {
-               pm_runtime_mark_last_busy(dev);
-               ret = pm_runtime_put_autosuspend(dev);
-       }
+       if (on)
+               return pm_runtime_resume_and_get(dev);
 
-       return ret;
+       return pm_runtime_put_autosuspend(dev);
 }
 
 /* Channel IO */
index 61f57a82b8727978a7a8ff6b6ff73a76f20da217..5f27f754fe1c444291fd7450a78f3972a02b24a7 100644 (file)
@@ -208,7 +208,6 @@ static int ltrf216a_set_power_state(struct ltrf216a_data *data, bool on)
                        return ret;
                }
        } else {
-               pm_runtime_mark_last_busy(dev);
                pm_runtime_put_autosuspend(dev);
        }
 
index 8885852bef22d72262b1b715c9503e2adf2eb94e..98a1f1624c755e211223dc33d7d075548da44b2e 100644 (file)
@@ -185,15 +185,10 @@ static int pa12203001_set_power_state(struct pa12203001_data *data, bool on,
                mutex_unlock(&data->lock);
        }
 
-       if (on) {
-               ret = pm_runtime_resume_and_get(&data->client->dev);
+       if (on)
+               return pm_runtime_resume_and_get(&data->client->dev);
 
-       } else {
-               pm_runtime_mark_last_busy(&data->client->dev);
-               ret = pm_runtime_put_autosuspend(&data->client->dev);
-       }
-
-       return ret;
+       return pm_runtime_put_autosuspend(&data->client->dev);
 
 err:
        mutex_unlock(&data->lock);
index fbd116272921f16cde89d4c421f2b1bb22ec791c..9341c1d58cbe35ff9c301ad98e4fcdbf6683472a 100644 (file)
@@ -358,12 +358,10 @@ static int rpr0521_set_power_state(struct rpr0521_data *data, bool on,
         * Note: If either measurement is re-enabled before _suspend(),
         * both stay enabled until _suspend().
         */
-       if (on) {
+       if (on)
                ret = pm_runtime_resume_and_get(&data->client->dev);
-       } else {
-               pm_runtime_mark_last_busy(&data->client->dev);
+       else
                ret = pm_runtime_put_autosuspend(&data->client->dev);
-       }
        if (ret < 0) {
                dev_err(&data->client->dev,
                        "Failed: rpr0521_set_power_state for %d, ret %d\n",
index fc3b0c4226be876f87115f1e36abaa8a92376a17..8801a491de77b58d63be7ccfb5edca3a4ada453e 100644 (file)
@@ -641,16 +641,10 @@ static const struct iio_chan_spec tsl2583_channels[] = {
 
 static int tsl2583_set_pm_runtime_busy(struct tsl2583_chip *chip, bool on)
 {
-       int ret;
+       if (on)
+               return pm_runtime_resume_and_get(&chip->client->dev);
 
-       if (on) {
-               ret = pm_runtime_resume_and_get(&chip->client->dev);
-       } else {
-               pm_runtime_mark_last_busy(&chip->client->dev);
-               ret = pm_runtime_put_autosuspend(&chip->client->dev);
-       }
-
-       return ret;
+       return pm_runtime_put_autosuspend(&chip->client->dev);
 }
 
 static int tsl2583_read_raw(struct iio_dev *indio_dev,
index 08476f193a443f7e513bf342157ff4dce9fc3460..c5557867ea43d1305c05f4bee0983b97d2d2c620 100644 (file)
@@ -772,7 +772,6 @@ static int tsl2591_read_raw(struct iio_dev *indio_dev,
 err_unlock:
        mutex_unlock(&chip->als_mutex);
 
-       pm_runtime_mark_last_busy(&client->dev);
        pm_runtime_put_autosuspend(&client->dev);
 
        return ret;
@@ -995,7 +994,6 @@ static int tsl2591_write_event_config(struct iio_dev *indio_dev,
                pm_runtime_get_sync(&client->dev);
        } else if (!state && chip->events_enabled) {
                chip->events_enabled = false;
-               pm_runtime_mark_last_busy(&client->dev);
                pm_runtime_put_autosuspend(&client->dev);
        }
 
index 61a0957317a1aa7fde67f5911de276efd55653f0..d2f5a44892a882c6ec61168e4d015cea502b6ee6 100644 (file)
@@ -361,19 +361,13 @@ static int us5182d_shutdown_en(struct us5182d_data *data, u8 state)
 
 static int us5182d_set_power_state(struct us5182d_data *data, bool on)
 {
-       int ret;
-
        if (data->power_mode == US5182D_ONESHOT)
                return 0;
 
-       if (on) {
-               ret = pm_runtime_resume_and_get(&data->client->dev);
-       } else {
-               pm_runtime_mark_last_busy(&data->client->dev);
-               ret = pm_runtime_put_autosuspend(&data->client->dev);
-       }
+       if (on)
+               return pm_runtime_resume_and_get(&data->client->dev);
 
-       return ret;
+       return pm_runtime_put_autosuspend(&data->client->dev);
 }
 
 static int us5182d_read_value(struct us5182d_data *data,
index cc81a30b7c701d0a7d3820feb135243ac307dcf8..4dbb2294a843194124b981c32730e60cfb641a40 100644 (file)
@@ -576,16 +576,11 @@ static bool vcnl4010_is_in_periodic_mode(struct vcnl4000_data *data)
 static int vcnl4000_set_pm_runtime_state(struct vcnl4000_data *data, bool on)
 {
        struct device *dev = &data->client->dev;
-       int ret;
 
-       if (on) {
-               ret = pm_runtime_resume_and_get(dev);
-       } else {
-               pm_runtime_mark_last_busy(dev);
-               ret = pm_runtime_put_autosuspend(dev);
-       }
+       if (on)
+               return pm_runtime_resume_and_get(dev);
 
-       return ret;
+       return pm_runtime_put_autosuspend(dev);
 }
 
 static int vcnl4040_read_als_it(struct vcnl4000_data *data, int *val, int *val2)
index 01bc99564f985ff9d4f7b725e2e7987d4a02adb8..963747927425f7c525eabc512f71ce2885cbc561 100644 (file)
@@ -141,17 +141,12 @@ static const struct iio_trigger_ops vcnl4035_trigger_ops = {
 
 static int vcnl4035_set_pm_runtime_state(struct vcnl4035_data *data, bool on)
 {
-       int ret;
        struct device *dev = &data->client->dev;
 
-       if (on) {
-               ret = pm_runtime_resume_and_get(dev);
-       } else {
-               pm_runtime_mark_last_busy(dev);
-               ret = pm_runtime_put_autosuspend(dev);
-       }
+       if (on)
+               return pm_runtime_resume_and_get(dev);
 
-       return ret;
+       return pm_runtime_put_autosuspend(dev);
 }
 
 static int vcnl4035_read_info_raw(struct iio_dev *indio_dev,