]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iio: adc: Remove redundant pm_runtime_mark_last_busy() calls
authorSakari Ailus <sakari.ailus@linux.intel.com>
Mon, 25 Aug 2025 13:53:51 +0000 (16:53 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 25 Aug 2025 14:57:14 +0000 (15:57 +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>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Link: https://patch.msgid.link/20250825135401.1765847-3-sakari.ailus@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
12 files changed:
drivers/iio/adc/ab8500-gpadc.c
drivers/iio/adc/at91-sama5d2_adc.c
drivers/iio/adc/imx8qxp-adc.c
drivers/iio/adc/imx93_adc.c
drivers/iio/adc/rcar-gyroadc.c
drivers/iio/adc/rzg2l_adc.c
drivers/iio/adc/stm32-adc-core.c
drivers/iio/adc/stm32-adc.c
drivers/iio/adc/sun4i-gpadc-iio.c
drivers/iio/adc/ti-ads1015.c
drivers/iio/adc/ti-ads1100.c
drivers/iio/adc/ti-ads1119.c

index f3b057f9231004e99b5b5844fc72e16f485a75ed..8eaa1dd6a89b79223c37397cc4e76fa441f8cd73 100644 (file)
@@ -607,7 +607,6 @@ static int ab8500_gpadc_read(struct ab8500_gpadc *gpadc,
        }
 
        /* This eventually drops the regulator */
-       pm_runtime_mark_last_busy(gpadc->dev);
        pm_runtime_put_autosuspend(gpadc->dev);
 
        return (high_data << 8) | low_data;
index c3450246730e08cdacc975ed19f46044dc76848f..b4c36e6a7490aa9002a702e70a8b37ee3eae6324 100644 (file)
@@ -896,7 +896,6 @@ static int at91_adc_config_emr(struct at91_adc_state *st,
        emr |= osr | AT91_SAMA5D2_TRACKX(trackx);
        at91_adc_writel(st, EMR, emr);
 
-       pm_runtime_mark_last_busy(st->dev);
        pm_runtime_put_autosuspend(st->dev);
 
        st->oversampling_ratio = oversampling_ratio;
@@ -971,7 +970,6 @@ static int at91_adc_configure_touch(struct at91_adc_state *st, bool state)
                                AT91_SAMA5D2_IER_PEN | AT91_SAMA5D2_IER_NOPEN);
                at91_adc_writel(st, TSMR, 0);
 
-               pm_runtime_mark_last_busy(st->dev);
                pm_runtime_put_autosuspend(st->dev);
                return 0;
        }
@@ -1142,10 +1140,8 @@ static int at91_adc_configure_trigger(struct iio_trigger *trig, bool state)
 
        at91_adc_configure_trigger_registers(st, state);
 
-       if (!state) {
-               pm_runtime_mark_last_busy(st->dev);
+       if (!state)
                pm_runtime_put_autosuspend(st->dev);
-       }
 
        return 0;
 }
@@ -1336,7 +1332,6 @@ static int at91_adc_buffer_prepare(struct iio_dev *indio_dev)
                at91_adc_writel(st, IER, AT91_SAMA5D2_IER_DRDY);
 
 pm_runtime_put:
-       pm_runtime_mark_last_busy(st->dev);
        pm_runtime_put_autosuspend(st->dev);
        return ret;
 }
@@ -1394,7 +1389,6 @@ static int at91_adc_buffer_postdisable(struct iio_dev *indio_dev)
        if (st->dma_st.dma_chan)
                dmaengine_terminate_sync(st->dma_st.dma_chan);
 
-       pm_runtime_mark_last_busy(st->dev);
        pm_runtime_put_autosuspend(st->dev);
 
        return 0;
@@ -1603,7 +1597,6 @@ static void at91_adc_setup_samp_freq(struct iio_dev *indio_dev, unsigned freq,
        mr |= AT91_SAMA5D2_MR_TRACKTIM(tracktim);
        at91_adc_writel(st, MR, mr);
 
-       pm_runtime_mark_last_busy(st->dev);
        pm_runtime_put_autosuspend(st->dev);
 
        dev_dbg(&indio_dev->dev, "freq: %u, startup: %u, prescal: %u, tracktim=%u\n",
@@ -1809,7 +1802,6 @@ static int at91_adc_read_info_raw(struct iio_dev *indio_dev,
        at91_adc_readl(st, LCDR);
 
 pm_runtime_put:
-       pm_runtime_mark_last_busy(st->dev);
        pm_runtime_put_autosuspend(st->dev);
        return ret;
 }
@@ -1890,7 +1882,6 @@ static int at91_adc_read_temp(struct iio_dev *indio_dev,
 restore_config:
        /* Revert previous settings. */
        at91_adc_temp_sensor_configure(st, false);
-       pm_runtime_mark_last_busy(st->dev);
        pm_runtime_put_autosuspend(st->dev);
        if (ret < 0)
                return ret;
@@ -2465,7 +2456,6 @@ static int at91_adc_probe(struct platform_device *pdev)
        dev_info(&pdev->dev, "version: %x\n",
                 readl_relaxed(st->base + st->soc_info.platform->layout->VERSION));
 
-       pm_runtime_mark_last_busy(st->dev);
        pm_runtime_put_autosuspend(st->dev);
 
        return 0;
@@ -2567,7 +2557,6 @@ static int at91_adc_resume(struct device *dev)
                at91_adc_configure_trigger_registers(st, true);
        }
 
-       pm_runtime_mark_last_busy(st->dev);
        pm_runtime_put_autosuspend(st->dev);
 
        return 0;
index 427ee9f244084289336b9ebad4a907029251a005..6fc50394ad90ce3a909284e2fdcf8f94796385fb 100644 (file)
@@ -229,7 +229,6 @@ static int imx8qxp_adc_read_raw(struct iio_dev *indio_dev,
                ret = wait_for_completion_interruptible_timeout(&adc->completion,
                                                                IMX8QXP_ADC_TIMEOUT);
 
-               pm_runtime_mark_last_busy(dev);
                pm_runtime_put_sync_autosuspend(dev);
 
                if (ret == 0) {
@@ -295,7 +294,6 @@ static int imx8qxp_adc_reg_access(struct iio_dev *indio_dev, unsigned int reg,
 
        *readval = readl(adc->regs + reg);
 
-       pm_runtime_mark_last_busy(dev);
        pm_runtime_put_sync_autosuspend(dev);
 
        return 0;
index b865bbc945179de7a1b2ff92af769a7af1ff4a61..787e80db5de389365223dce877a1ae2c727cf047 100644 (file)
@@ -260,7 +260,6 @@ static int imx93_adc_read_raw(struct iio_dev *indio_dev,
                mutex_lock(&adc->lock);
                ret = imx93_adc_read_channel_conversion(adc, chan->channel, val);
                mutex_unlock(&adc->lock);
-               pm_runtime_mark_last_busy(dev);
                pm_runtime_put_sync_autosuspend(dev);
                if (ret < 0)
                        return ret;
index cc326f21d398271ca3c37d2c0c39209c766eb9f0..3a17b3898bf67b67eb64a45b69b15eae7bc45bc8 100644 (file)
@@ -163,12 +163,10 @@ static int rcar_gyroadc_set_power(struct rcar_gyroadc *priv, bool on)
 {
        struct device *dev = priv->dev;
 
-       if (on) {
+       if (on)
                return pm_runtime_resume_and_get(dev);
-       } else {
-               pm_runtime_mark_last_busy(dev);
-               return pm_runtime_put_autosuspend(dev);
-       }
+
+       return pm_runtime_put_autosuspend(dev);
 }
 
 static int rcar_gyroadc_read_raw(struct iio_dev *indio_dev,
index 9674d48074c9a7d88b0378159ad3659754a884d7..75c0a96b0ace2365c4c4b52080b0bcdcb4a63991 100644 (file)
@@ -249,7 +249,6 @@ static int rzg2l_adc_conversion(struct iio_dev *indio_dev, struct rzg2l_adc *adc
        rzg2l_adc_start_stop(adc, false);
 
 rpm_put:
-       pm_runtime_mark_last_busy(dev);
        pm_runtime_put_autosuspend(dev);
        return ret;
 }
@@ -411,7 +410,6 @@ static int rzg2l_adc_hw_init(struct device *dev, struct rzg2l_adc *adc)
        rzg2l_adc_writel(adc, RZG2L_ADM(3), reg);
 
 exit_hw_init:
-       pm_runtime_mark_last_busy(dev);
        pm_runtime_put_autosuspend(dev);
        return ret;
 }
index 3d800762c5fcbfcf9bee91cb8fb1479a1dccab0c..e39a4c0db25eaa3a79c657e8652a8187ed672c31 100644 (file)
@@ -794,7 +794,6 @@ static int stm32_adc_probe(struct platform_device *pdev)
                goto err_irq_remove;
        }
 
-       pm_runtime_mark_last_busy(dev);
        pm_runtime_put_autosuspend(dev);
 
        return 0;
index b9f93116e114b1c840cbe568f17462b2d25bf2db..2d7f88459c7ceddcf13485dfd6ca6373367ba2ba 100644 (file)
@@ -1528,7 +1528,6 @@ static int stm32_adc_single_conv(struct iio_dev *indio_dev,
 
        stm32_adc_conv_irq_disable(adc);
 
-       pm_runtime_mark_last_busy(dev);
        pm_runtime_put_autosuspend(dev);
 
        return ret;
@@ -1564,7 +1563,6 @@ static int stm32_adc_write_raw(struct iio_dev *indio_dev,
 
                adc->cfg->set_ovs(indio_dev, idx);
 
-               pm_runtime_mark_last_busy(dev);
                pm_runtime_put_autosuspend(dev);
 
                adc->ovs_idx = idx;
@@ -1759,7 +1757,6 @@ static int stm32_adc_update_scan_mode(struct iio_dev *indio_dev,
        adc->num_conv = bitmap_weight(scan_mask, iio_get_masklength(indio_dev));
 
        ret = stm32_adc_conf_scan_seq(indio_dev, scan_mask);
-       pm_runtime_mark_last_busy(dev);
        pm_runtime_put_autosuspend(dev);
 
        return ret;
@@ -1808,7 +1805,6 @@ static int stm32_adc_debugfs_reg_access(struct iio_dev *indio_dev,
        else
                *readval = stm32_adc_readl(adc, reg);
 
-       pm_runtime_mark_last_busy(dev);
        pm_runtime_put_autosuspend(dev);
 
        return 0;
@@ -1954,7 +1950,6 @@ static int stm32_adc_buffer_postenable(struct iio_dev *indio_dev)
 err_clr_trig:
        stm32_adc_set_trig(indio_dev, NULL);
 err_pm_put:
-       pm_runtime_mark_last_busy(dev);
        pm_runtime_put_autosuspend(dev);
 
        return ret;
@@ -1977,7 +1972,6 @@ static int stm32_adc_buffer_predisable(struct iio_dev *indio_dev)
        if (stm32_adc_set_trig(indio_dev, NULL))
                dev_err(&indio_dev->dev, "Can't clear trigger\n");
 
-       pm_runtime_mark_last_busy(dev);
        pm_runtime_put_autosuspend(dev);
 
        return 0;
@@ -2614,7 +2608,6 @@ static int stm32_adc_probe(struct platform_device *pdev)
                goto err_hw_stop;
        }
 
-       pm_runtime_mark_last_busy(dev);
        pm_runtime_put_autosuspend(dev);
 
        if (IS_ENABLED(CONFIG_DEBUG_FS))
index e4bc2e199a076ec724ed6dfa157b3c4c057b00df..479115ea50bf9316d88015e68577e44e9fc5c897 100644 (file)
@@ -244,7 +244,6 @@ static int sun4i_gpadc_read(struct iio_dev *indio_dev, int channel, int *val,
                *val = info->temp_data;
 
        ret = 0;
-       pm_runtime_mark_last_busy(indio_dev->dev.parent);
 
 err:
        pm_runtime_put_autosuspend(indio_dev->dev.parent);
@@ -271,7 +270,6 @@ static int sun4i_gpadc_temp_read(struct iio_dev *indio_dev, int *val)
 
                regmap_read(info->regmap, SUN4I_GPADC_TEMP_DATA, val);
 
-               pm_runtime_mark_last_busy(indio_dev->dev.parent);
                pm_runtime_put_autosuspend(indio_dev->dev.parent);
 
                return 0;
index 48549d617e5fdc363a5ff583a2b303cc8adc9eae..f2a93c63ca14e2fa2a6c52243cb11af5aca8e6dc 100644 (file)
@@ -374,12 +374,10 @@ static int ads1015_set_power_state(struct ads1015_data *data, bool on)
        int ret;
        struct device *dev = regmap_get_device(data->regmap);
 
-       if (on) {
+       if (on)
                ret = pm_runtime_resume_and_get(dev);
-       } else {
-               pm_runtime_mark_last_busy(dev);
+       else
                ret = pm_runtime_put_autosuspend(dev);
-       }
 
        return ret < 0 ? ret : 0;
 }
index b0790e300b18f7edd697ae515439b2150a73fe13..aa8946063c7d6d05a0c35d7efff919f345831b5b 100644 (file)
@@ -105,7 +105,6 @@ static int ads1100_get_adc_result(struct ads1100_data *data, int chan, int *val)
 
        ret = i2c_master_recv(data->client, (char *)&buffer, sizeof(buffer));
 
-       pm_runtime_mark_last_busy(&data->client->dev);
        pm_runtime_put_autosuspend(&data->client->dev);
 
        if (ret < 0) {
index 2d70b2662f41249dd1ae33a3d16e261aac5fd71b..c9cedc59cdcdb1cdc0563455d6b5c75270960dc8 100644 (file)
@@ -291,7 +291,6 @@ static int ads1119_single_conversion(struct ads1119_state *st,
        *val = sign_extend32(sample, chan->scan_type.realbits - 1);
        ret = IIO_VAL_INT;
 pdown:
-       pm_runtime_mark_last_busy(dev);
        pm_runtime_put_autosuspend(dev);
        return ret;
 }
@@ -470,7 +469,6 @@ static int ads1119_triggered_buffer_postdisable(struct iio_dev *indio_dev)
        if (ret)
                return ret;
 
-       pm_runtime_mark_last_busy(dev);
        pm_runtime_put_autosuspend(dev);
 
        return 0;