iio: Remove redundant pm_runtime_mark_last_busy() calls
Subsystems (25)
v3 cover iio: Remove redundant pm_runtime_mark_last_busy() calls
Hello everyone,
Late last year I posted a set to switch to __pm_runtime_mark_last_busy() and gradually get rid of explicit pm_runtime_mark_last_busy() calls in drivers, embedding them in the appropriate pm_runtime_*autosuspend*() calls. The overall feedback I got at the time was that this is an unnecessary intermediate step, and removing the pm_runtime_mark_last_busy() calls can be done after adding them to the relevant Runtime PM autosuspend related functions. The latter part has been done and is present in v6.17-rc1.
These patches are on next-20250825.
It'd be nice to merge these as fixes for 6.17.
since v2:
- Drop some unneeded newlines.
- Further clean up stm32_dac_set_enable_state().
- Avoid #ifdefs in bmc150_magn_set_power_state() by assuming pm_runtime_put_autosuspend() won't meaningfully fail (and what would you do about it anyway?).
since v1:
- Drop unneeded braces.
- Further rework call sites that simply assigned a local variable (ret) to return it, by removing that local variable and the redundant else clause.
The diff from rebased v2 (<[email protected]>) for iio patches is:
drivers/iio/accel/bmc150-accel-core.c +0 -1
@@ -336,7 +336,6 @@ static int bmc150_accel_set_power_state(struct bmc150_accel_data *data, bool on) ret =pm_runtime_resume_and_get (dev); else ret =pm_runtime_put_autosuspend (dev); -if (ret <0 ) {dev_err (dev,"Failed: %s for %d\n" , __func__, on);
drivers/iio/accel/mma8452.c +0 -1
@@ -228,7 +228,6 @@ static int mma8452_set_runtime_pm_state(struct i2c_client *client, bool on) ret =pm_runtime_resume_and_get (&client->dev); else ret =pm_runtime_put_autosuspend (&client->dev); -if (ret <0 ) {dev_err (&client->dev,"failed to change power state to %d\n" , on);
drivers/iio/accel/mma9551_core.c +0 -1
@@ -673,7 +673,6 @@ int mma9551_set_power_state(struct i2c_client *client, bool on) ret =pm_runtime_resume_and_get (&client->dev); else ret =pm_runtime_put_autosuspend (&client->dev); -if (ret <0 ) {dev_err (&client->dev,"failed to change power state to %d\n" , on);
drivers/iio/dac/stm32-dac.c +4 -10
@@ -82,9 +82,9 @@ static int stm32_dac_set_enable_state(struct iio_dev *indio_dev, int ch, ret =regmap_update_bits (dac->common->regmap,STM32_DAC_CR , msk, en);mutex_unlock (&dac->lock); -if (ret <0 ) { +if (ret) {dev_err (&indio_dev->dev,"%s failed\n" ,str_enable_disable (en)); - goto err_put_pm; + goto err_pm_put; }/*
@@ -95,14 +95,8 @@ static int stm32_dac_set_enable_state(struct iio_dev *indio_dev, int ch,if (en && dac->common->hfsel)udelay (1 ); -if (!enable) -pm_runtime_put_autosuspend (dev); - -return 0 ; - -err_put_pm: -if (enable) -pm_runtime_put_autosuspend (dev); +err_pm_put: +pm_runtime_put_autosuspend (dev);return ret; }
drivers/iio/magnetometer/bmc150_magn.c +2 -5
@@ -257,20 +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) ret =pm_runtime_resume_and_get (data->dev);else - ret =pm_runtime_put_autosuspend (data->dev); - +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 ; }
Sakari Ailus (12):
iio: accel: Remove redundant pm_runtime_mark_last_busy() calls
iio: adc: Remove redundant pm_runtime_mark_last_busy() calls
iio: chemical: Remove redundant pm_runtime_mark_last_busy() calls
iio: common: Remove redundant pm_runtime_mark_last_busy() calls
iio: dac: Remove redundant pm_runtime_mark_last_busy() calls
iio: gyro: Remove redundant pm_runtime_mark_last_busy() calls
iio: imu: Remove redundant pm_runtime_mark_last_busy() calls
iio: light: Remove redundant pm_runtime_mark_last_busy() calls
iio: magnetometer: Remove redundant pm_runtime_mark_last_busy() calls
iio: pressure: Remove redundant pm_runtime_mark_last_busy() calls
iio: proximity: Remove redundant pm_runtime_mark_last_busy() calls
iio: temperature: Remove redundant pm_runtime_mark_last_busy() calls
drivers/iio/accel/bmc150-accel-core.c | 7 ++----- drivers/iio/accel/bmi088-accel-core.c | 3 --- drivers/iio/accel/fxls8962af-core.c | 1 - drivers/iio/accel/kxcjk-1013.c | 4 +--- drivers/iio/accel/kxsd9.c | 3 --- drivers/iio/accel/mma8452.c | 7 ++----- drivers/iio/accel/mma9551_core.c | 5 +---- drivers/iio/accel/msa311.c | 6 ------ drivers/iio/adc/ab8500-gpadc.c | 1 - drivers/iio/adc/at91-sama5d2_adc.c | 13 +------------ drivers/iio/adc/imx8qxp-adc.c | 2 -- drivers/iio/adc/imx93_adc.c | 1 - drivers/iio/adc/rcar-gyroadc.c | 8 +++----- drivers/iio/adc/rzg2l_adc.c | 2 -- drivers/iio/adc/stm32-adc-core.c | 1 - drivers/iio/adc/stm32-adc.c | 7 ------- drivers/iio/adc/sun4i-gpadc-iio.c | 2 -- drivers/iio/adc/ti-ads1015.c | 6 ++---- drivers/iio/adc/ti-ads1100.c | 1 - drivers/iio/adc/ti-ads1119.c | 2 -- drivers/iio/chemical/atlas-sensor.c | 2 -- drivers/iio/chemical/bme680_core.c | 3 --- .../common/hid-sensors/hid-sensor-trigger.c | 1 - drivers/iio/dac/stm32-dac.c | 19 ++++--------------- drivers/iio/gyro/bmg160_core.c | 4 +--- drivers/iio/gyro/fxas21002c_core.c | 2 -- drivers/iio/gyro/mpu3050-core.c | 3 --- drivers/iio/gyro/mpu3050-i2c.c | 1 - .../iio/imu/inv_icm42600/inv_icm42600_accel.c | 5 ----- .../imu/inv_icm42600/inv_icm42600_buffer.c | 1 - .../iio/imu/inv_icm42600/inv_icm42600_gyro.c | 5 ----- .../iio/imu/inv_icm42600/inv_icm42600_temp.c | 1 - drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 6 ------ drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c | 1 - drivers/iio/imu/kmx61.c | 6 ++---- drivers/iio/light/apds9306.c | 2 -- drivers/iio/light/apds9960.c | 1 - drivers/iio/light/bh1780.c | 1 - drivers/iio/light/gp2ap002.c | 2 -- drivers/iio/light/isl29028.c | 11 +++-------- drivers/iio/light/ltrf216a.c | 1 - drivers/iio/light/pa12203001.c | 11 +++-------- drivers/iio/light/rpr0521.c | 6 ++---- drivers/iio/light/tsl2583.c | 12 +++--------- drivers/iio/light/tsl2591.c | 2 -- drivers/iio/light/us5182d.c | 12 +++--------- drivers/iio/light/vcnl4000.c | 11 +++-------- drivers/iio/light/vcnl4035.c | 11 +++-------- drivers/iio/magnetometer/ak8974.c | 2 -- drivers/iio/magnetometer/ak8975.c | 1 - drivers/iio/magnetometer/als31300.c | 2 -- drivers/iio/magnetometer/bmc150_magn.c | 13 ++++--------- drivers/iio/magnetometer/tmag5273.c | 2 -- drivers/iio/magnetometer/yamaha-yas530.c | 2 -- drivers/iio/pressure/bmp280-core.c | 5 ----- drivers/iio/pressure/icp10100.c | 1 - drivers/iio/pressure/mpl115.c | 2 -- drivers/iio/pressure/zpa2326.c | 2 -- .../iio/proximity/pulsedlight-lidar-lite-v2.c | 1 - drivers/iio/proximity/srf04.c | 4 +--- drivers/iio/temperature/mlx90614.c | 1 - drivers/iio/temperature/mlx90632.c | 1 - drivers/iio/temperature/mlx90635.c | 1 - 63 files changed, 44 insertions(+), 221 deletions(-)
Signature · 1 line
2.47.2
PATCH v3 1/12 iio: accel: Remove redundant pm_runtime_mark_last_busy() calls
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().
--- drivers/iio/accel/bmc150-accel-core.c | 7 ++----- drivers/iio/accel/bmi088-accel-core.c | 3 --- drivers/iio/accel/fxls8962af-core.c | 1 - drivers/iio/accel/kxcjk-1013.c | 4 +--- drivers/iio/accel/kxsd9.c | 3 --- drivers/iio/accel/mma8452.c | 7 ++----- drivers/iio/accel/mma9551_core.c | 5 +---- drivers/iio/accel/msa311.c | 6 ------ 8 files changed, 6 insertions(+), 30 deletions(-)
drivers/iio/accel/bmc150-accel-core.c +2 -5
@@ -332,13 +332,10 @@ static int bmc150_accel_set_power_state(struct bmc150_accel_data *data, bool on)struct device *dev =regmap_get_device (data->regmap);int ret; -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); - } -if (ret <0 ) {dev_err (dev,"Failed: %s for %d\n" , __func__, on);
drivers/iio/accel/bmi088-accel-core.c +0 -3
@@ -375,7 +375,6 @@ static int bmi088_accel_read_raw(struct iio_dev *indio_dev,return -EINVAL ; out_read_raw_pm_put: -pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);return ret;
@@ -419,7 +418,6 @@ static int bmi088_accel_write_raw(struct iio_dev *indio_dev,return ret; ret =bmi088_accel_set_scale (data, val, val2); -pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);return ret;case IIO_CHAN_INFO_SAMP_FREQ :
@@ -428,7 +426,6 @@ static int bmi088_accel_write_raw(struct iio_dev *indio_dev,return ret; ret =bmi088_accel_set_sample_freq (data, val); -pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);return ret;default :
drivers/iio/accel/fxls8962af-core.c +0 -1
@@ -222,7 +222,6 @@ static int fxls8962af_power_off(struct fxls8962af_data *data)struct device *dev =regmap_get_device (data->regmap);int ret; -pm_runtime_mark_last_busy (dev); ret =pm_runtime_put_autosuspend (dev);if (ret)dev_err (dev,"failed to power off\n" );
drivers/iio/accel/kxcjk-1013.c +1 -3
@@ -636,10 +636,8 @@ static int kxcjk1013_set_power_state(struct kxcjk1013_data *data, bool 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: %s for %d\n" , __func__, on);
drivers/iio/accel/kxsd9.c +0 -3
@@ -151,7 +151,6 @@ static int kxsd9_write_raw(struct iio_dev *indio_dev, ret =kxsd9_write_scale (indio_dev, val2); } -pm_runtime_mark_last_busy (st->dev);pm_runtime_put_autosuspend (st->dev);return ret;
@@ -199,7 +198,6 @@ static int kxsd9_read_raw(struct iio_dev *indio_dev, } error_ret: -pm_runtime_mark_last_busy (st->dev);pm_runtime_put_autosuspend (st->dev);return ret;
@@ -250,7 +248,6 @@ static int kxsd9_buffer_postdisable(struct iio_dev *indio_dev) {struct kxsd9_state *st =iio_priv (indio_dev); -pm_runtime_mark_last_busy (st->dev);pm_runtime_put_autosuspend (st->dev);return 0 ;
drivers/iio/accel/mma8452.c +2 -5
@@ -224,13 +224,10 @@ static int mma8452_set_runtime_pm_state(struct i2c_client *client, bool on)#ifdef CONFIG_PM int ret; -if (on) { +if (on) ret =pm_runtime_resume_and_get (&client->dev); - }else { -pm_runtime_mark_last_busy (&client->dev); +else ret =pm_runtime_put_autosuspend (&client->dev); - } -if (ret <0 ) {dev_err (&client->dev,"failed to change power state to %d\n" , on);
drivers/iio/accel/mma9551_core.c +1 -4
@@ -671,11 +671,8 @@ int mma9551_set_power_state(struct i2c_client *client, bool on)if (on) ret =pm_runtime_resume_and_get (&client->dev); -else { -pm_runtime_mark_last_busy (&client->dev); +else ret =pm_runtime_put_autosuspend (&client->dev); - } -if (ret <0 ) {dev_err (&client->dev,"failed to change power state to %d\n" , on);
drivers/iio/accel/msa311.c +0 -6
@@ -607,7 +607,6 @@ static int msa311_read_raw_data(struct iio_dev *indio_dev, err =msa311_get_axis (msa311, chan, &axis);mutex_unlock (&msa311->lock); -pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);iio_device_release_direct (indio_dev);
@@ -741,7 +740,6 @@ static int msa311_write_scale(struct iio_dev *indio_dev, int val, int val2)break ; } -pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);if (err)
@@ -781,7 +779,6 @@ static int msa311_write_samp_freq(struct iio_dev *indio_dev, int val, int val2)break ; } -pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);iio_device_release_direct (indio_dev);
@@ -832,7 +829,6 @@ static int msa311_debugfs_reg_access(struct iio_dev *indio_dev,mutex_unlock (&msa311->lock); -pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);if (err)
@@ -855,7 +851,6 @@ static int msa311_buffer_postdisable(struct iio_dev *indio_dev)struct msa311_priv *msa311 =iio_priv (indio_dev);struct device *dev = msa311->dev; -pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);return 0 ;
@@ -1231,7 +1226,6 @@ static int msa311_probe(struct i2c_client *i2c)if (err)return err; -pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev); err =devm_iio_device_register (dev, indio_dev);
Signature · 1 line
2.47.2
Jonathan Cameron
maintainerRe: [PATCH v3 01/12] iio: accel: Remove redundant pm_runtime_mark_last_busy() calls
Quoted 6 lines · On Mon, 25 Aug 2025 16:53:50 +0300 Sakari Ailus <[email protected]>…
pm_runtime_put_autosuspend(),pm_runtime_put_sync_autosuspend(),pm_runtime_autosuspend()andpm_request_autosuspend()now include a call topm_runtime_mark_last_busy(). Remove the now-reduntant explicit call topm_runtime_mark_last_busy().Signed-off-by Sakari Ailus <[email protected]>
Very simple and mechanical change so I won't wait for additional reviews.
I'm doing these one by one as I have questions on at least one later patch.
Applied this one.
PATCH v3 2/12 iio: adc: Remove redundant pm_runtime_mark_last_busy() calls
In reply to Sakari Ailuspm_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().
--- drivers/iio/adc/ab8500-gpadc.c | 1 - drivers/iio/adc/at91-sama5d2_adc.c | 13 +------------ drivers/iio/adc/imx8qxp-adc.c | 2 -- drivers/iio/adc/imx93_adc.c | 1 - drivers/iio/adc/rcar-gyroadc.c | 8 +++----- drivers/iio/adc/rzg2l_adc.c | 2 -- drivers/iio/adc/stm32-adc-core.c | 1 - drivers/iio/adc/stm32-adc.c | 7 ------- drivers/iio/adc/sun4i-gpadc-iio.c | 2 -- drivers/iio/adc/ti-ads1015.c | 6 ++---- drivers/iio/adc/ti-ads1100.c | 1 - drivers/iio/adc/ti-ads1119.c | 2 -- 12 files changed, 6 insertions(+), 40 deletions(-)
drivers/iio/adc/ab8500-gpadc.c +0 -1
@@ -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;
drivers/iio/adc/at91-sama5d2_adc.c +1 -12
@@ -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 ;
drivers/iio/adc/imx8qxp-adc.c +0 -2
@@ -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 ;
drivers/iio/adc/imx93_adc.c +0 -1
@@ -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;
drivers/iio/adc/rcar-gyroadc.c +3 -5
@@ -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,
drivers/iio/adc/rzg2l_adc.c +0 -2
@@ -248,7 +248,6 @@ static int rzg2l_adc_conversion(struct iio_dev *indio_dev, struct rzg2l_adc *adcrzg2l_adc_start_stop (adc, false); rpm_put: -pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);return ret; }
@@ -410,7 +409,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; }
drivers/iio/adc/stm32-adc-core.c +0 -1
@@ -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 ;
drivers/iio/adc/stm32-adc.c +0 -7
@@ -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 ))
drivers/iio/adc/sun4i-gpadc-iio.c +0 -2
@@ -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 ;
drivers/iio/adc/ti-ads1015.c +2 -4
@@ -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 ; }
drivers/iio/adc/ti-ads1100.c +0 -1
@@ -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 ) {
drivers/iio/adc/ti-ads1119.c +0 -2
@@ -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 ;
Signature · 1 line
2.47.2
Re: [PATCH v3 02/12] iio: adc: Remove redundant pm_runtime_mark_last_busy() calls
Quoted 8 lines · On Mon, 25 Aug 2025 16:53:51 +0300 Sakari Ailus <[email protected]>…
pm_runtime_put_autosuspend(),pm_runtime_put_sync_autosuspend(),pm_runtime_autosuspend()andpm_request_autosuspend()now include a call topm_runtime_mark_last_busy(). Remove the now-reduntant explicit call topm_runtime_mark_last_busy().Signed-off-by Sakari Ailus <[email protected]>Reviewed-by Linus Walleij <[email protected]>Acked-by Chen-Yu Tsai <[email protected]>
Applied.
PATCH v3 3/12 iio: chemical: Remove redundant pm_runtime_mark_last_busy() calls
In reply to Sakari Ailuspm_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().
--- drivers/iio/chemical/atlas-sensor.c | 2 -- drivers/iio/chemical/bme680_core.c | 3 --- 2 files changed, 5 deletions(-)
drivers/iio/chemical/atlas-sensor.c +0 -2
@@ -425,7 +425,6 @@ static int atlas_buffer_predisable(struct iio_dev *indio_dev)if (ret)return ret; -pm_runtime_mark_last_busy (&data->client->dev); ret =pm_runtime_put_autosuspend (&data->client->dev);if (ret)return ret;
@@ -491,7 +490,6 @@ static int atlas_read_measurement(struct atlas_data *data, int reg, __be32 *val) ret =regmap_bulk_read (data->regmap, reg, val,sizeof (*val)); -pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);return ret;
drivers/iio/chemical/bme680_core.c +0 -3
@@ -950,7 +950,6 @@ static int bme680_read_raw(struct iio_dev *indio_dev,return ret; ret =__bme680_read_raw (indio_dev, chan, val, val2, mask); -pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);return ret;
@@ -1021,7 +1020,6 @@ static int bme680_write_raw(struct iio_dev *indio_dev,return ret; ret =__bme680_write_raw (indio_dev, chan, val, val2, mask); -pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);return ret;
@@ -1140,7 +1138,6 @@ static int bme680_buffer_postdisable(struct iio_dev *indio_dev)struct bme680_data *data =iio_priv (indio_dev);struct device *dev =regmap_get_device (data->regmap); -pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);return 0 ; }
Signature · 1 line
2.47.2
Re: [PATCH v3 03/12] iio: chemical: Remove redundant pm_runtime_mark_last_busy() calls
Quoted 6 lines · On Mon, 25 Aug 2025 16:53:52 +0300 Sakari Ailus <[email protected]>…
pm_runtime_put_autosuspend(),pm_runtime_put_sync_autosuspend(),pm_runtime_autosuspend()andpm_request_autosuspend()now include a call topm_runtime_mark_last_busy(). Remove the now-reduntant explicit call topm_runtime_mark_last_busy().Signed-off-by Sakari Ailus <[email protected]>
Applied.
PATCH v3 4/12 iio: common: Remove redundant pm_runtime_mark_last_busy() calls
In reply to Sakari Ailuspm_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().
--- drivers/iio/common/hid-sensors/hid-sensor-trigger.c | 1 - 1 file changed, 1 deletion(-)
drivers/iio/common/hid-sensors/hid-sensor-trigger.c +0 -1
@@ -163,7 +163,6 @@ int hid_sensor_power_state(struct hid_sensor_common *st, bool state) ret =pm_runtime_resume_and_get (&st->pdev->dev); }else {atomic_dec (&st->user_requested_state); -pm_runtime_mark_last_busy (&st->pdev->dev);pm_runtime_use_autosuspend (&st->pdev->dev); ret =pm_runtime_put_autosuspend (&st->pdev->dev); }
Signature · 1 line
2.47.2
Re: [PATCH v3 04/12] iio: common: Remove redundant pm_runtime_mark_last_busy() calls
Quoted 6 lines · On Mon, 25 Aug 2025 16:53:53 +0300 Sakari Ailus <[email protected]>…
pm_runtime_put_autosuspend(),pm_runtime_put_sync_autosuspend(),pm_runtime_autosuspend()andpm_request_autosuspend()now include a call topm_runtime_mark_last_busy(). Remove the now-reduntant explicit call topm_runtime_mark_last_busy().Signed-off-by Sakari Ailus <[email protected]>
Applied.
PATCH v3 5/12 iio: dac: Remove redundant pm_runtime_mark_last_busy() calls
In reply to Sakari Ailuspm_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 clean up error handling in stm32_dac_set_enable_state().
--- drivers/iio/dac/stm32-dac.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-)
drivers/iio/dac/stm32-dac.c +4 -15
@@ -82,9 +82,9 @@ static int stm32_dac_set_enable_state(struct iio_dev *indio_dev, int ch, ret =regmap_update_bits (dac->common->regmap,STM32_DAC_CR , msk, en);mutex_unlock (&dac->lock); -if (ret <0 ) { +if (ret) {dev_err (&indio_dev->dev,"%s failed\n" ,str_enable_disable (en)); - goto err_put_pm; + goto err_pm_put; }/*
@@ -95,18 +95,8 @@ static int stm32_dac_set_enable_state(struct iio_dev *indio_dev, int ch,if (en && dac->common->hfsel)udelay (1 ); -if (!enable) { -pm_runtime_mark_last_busy (dev); -pm_runtime_put_autosuspend (dev); - } - -return 0 ; - -err_put_pm: -if (enable) { -pm_runtime_mark_last_busy (dev); -pm_runtime_put_autosuspend (dev); - } +err_pm_put: +pm_runtime_put_autosuspend (dev);return ret; }
@@ -349,7 +339,6 @@ static int stm32_dac_probe(struct platform_device *pdev)if (ret) goto err_pm_put; -pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);return 0 ;
Signature · 1 line
2.47.2
Jonathan Cameron
maintainerRe: [PATCH v3 05/12] iio: dac: Remove redundant pm_runtime_mark_last_busy() calls
Quoted 8 lines · On Mon, 25 Aug 2025 16:53:54 +0300 Sakari Ailus <[email protected]>…
pm_runtime_put_autosuspend(),pm_runtime_put_sync_autosuspend(),pm_runtime_autosuspend()andpm_request_autosuspend()now include a call topm_runtime_mark_last_busy(). Remove the now-reduntant explicit call topm_runtime_mark_last_busy().Also clean up error handling in
stm32_dac_set_enable_state().Signed-off-by Sakari Ailus <[email protected]>
Hi Sakari,
I don't follow this...
Quoted 28 lines
--- drivers/iio/dac/stm32-dac.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-)drivers/iio/dac/stm32-dac.c +2
-6@@ -82,9 +82,9 @@ static int stm32_dac_set_enable_state(struct iio_dev *indio_dev, int ch, ret =regmap_update_bits (dac->common->regmap,STM32_DAC_CR , msk, en);mutex_unlock (&dac->lock); -if (ret <0 ) { +if (ret) {dev_err (&indio_dev->dev,"%s failed\n" ,str_enable_disable (en)); - goto err_put_pm; + goto err_pm_put; }/* @@ -95,18 +95,8 @@ static int stm32_dac_set_enable_state(struct iio_dev *indio_dev, int ch,if (en && dac->common->hfsel)udelay (1 ); -if (!enable) { -pm_runtime_mark_last_busy (dev); -pm_runtime_put_autosuspend (dev); - }
drivers/iio/dac/stm32-dac.c static int stm32_dac_set_enable_state(struct iio_dev *indio_dev, int ch, · line 99
Quoted 10 lines
drivers/iio/dac/stm32-dac.c +2
-8- -return 0 ; - -err_put_pm: -if (enable) { -pm_runtime_mark_last_busy (dev); -pm_runtime_put_autosuspend (dev); - } +err_pm_put: +pm_runtime_put_autosuspend (dev);
now the put is here, whether or not there was ever a get as the get is gated on enable()
Quoted 11 lines
drivers/iio/dac/stm32-dac.c +0
-1return ret; }@@ -349,7 +339,6 @@ static int stm32_dac_probe(struct platform_device *pdev)if (ret) goto err_pm_put; -pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);return 0 ;
Re: [PATCH v3 05/12] iio: dac: Remove redundant pm_runtime_mark_last_busy() calls
Hi Jonathan,
Quoted 13 lines · Jonathan Cameron
Quoted 13 lines
drivers/iio/dac/stm32-dac.c +0
-9@@ -95,18 +95,8 @@ static int stm32_dac_set_enable_state(struct iio_dev *indio_dev, int ch,if (en && dac->common->hfsel)udelay (1 ); -if (!enable) { -pm_runtime_mark_last_busy (dev); -pm_runtime_put_autosuspend (dev); - } - -return 0 ; - -err_put_pm: -if (enable) {
Quoted 8 lines
drivers/iio/dac/stm32-dac.c static int stm32_dac_set_enable_state(struct iio_dev *indio_dev, int ch, · line 99
Quoted 5 lines
drivers/iio/dac/stm32-dac.c +2
-3-pm_runtime_mark_last_busy (dev); -pm_runtime_put_autosuspend (dev); - } +err_pm_put: +pm_runtime_put_autosuspend (dev);now the put is here, whether or not there was ever a get as the get is gated on
enable()
Oops. I'll fix this in v4, with just this patch as the rest are merged.
Signature · 3 lines
Regards, Sakari Ailus
PATCH v3 6/12 iio: gyro: Remove redundant pm_runtime_mark_last_busy() calls
In reply to Sakari Ailuspm_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().
--- drivers/iio/gyro/bmg160_core.c | 4 +--- drivers/iio/gyro/fxas21002c_core.c | 2 -- drivers/iio/gyro/mpu3050-core.c | 3 --- drivers/iio/gyro/mpu3050-i2c.c | 1 - 4 files changed, 1 insertion(+), 9 deletions(-)
drivers/iio/gyro/bmg160_core.c +1 -3
@@ -309,10 +309,8 @@ static int bmg160_set_power_state(struct bmg160_data *data, bool on)if (on) ret =pm_runtime_get_sync (dev); -else { -pm_runtime_mark_last_busy (dev); +else ret =pm_runtime_put_autosuspend (dev); - }if (ret <0 ) {dev_err (dev,"Failed: bmg160_set_power_state for %d\n" , on);
drivers/iio/gyro/fxas21002c_core.c +0 -2
@@ -373,8 +373,6 @@ static int fxas21002c_pm_put(struct fxas21002c_data *data) {struct device *dev =regmap_get_device (data->regmap); -pm_runtime_mark_last_busy (dev); -return pm_runtime_put_autosuspend (dev); }
drivers/iio/gyro/mpu3050-core.c +0 -3
@@ -370,7 +370,6 @@ static int mpu3050_read_raw(struct iio_dev *indio_dev, out_read_raw_unlock:mutex_unlock (&mpu3050->lock); -pm_runtime_mark_last_busy (mpu3050->dev);pm_runtime_put_autosuspend (mpu3050->dev);return ret;
@@ -662,7 +661,6 @@ static int mpu3050_buffer_postdisable(struct iio_dev *indio_dev) {struct mpu3050 *mpu3050 =iio_priv (indio_dev); -pm_runtime_mark_last_busy (mpu3050->dev);pm_runtime_put_autosuspend (mpu3050->dev);return 0 ;
@@ -976,7 +974,6 @@ static int mpu3050_drdy_trigger_set_state(struct iio_trigger *trig,if (ret)dev_err (mpu3050->dev,"error resetting FIFO\n" ); -pm_runtime_mark_last_busy (mpu3050->dev);pm_runtime_put_autosuspend (mpu3050->dev); mpu3050->hw_irq_trigger = false;
drivers/iio/gyro/mpu3050-i2c.c +0 -1
@@ -27,7 +27,6 @@ static int mpu3050_i2c_bypass_deselect(struct i2c_mux_core *mux, u32 chan_id) {struct mpu3050 *mpu3050 =i2c_mux_priv (mux); -pm_runtime_mark_last_busy (mpu3050->dev);pm_runtime_put_autosuspend (mpu3050->dev);return 0 ; }
Signature · 1 line
2.47.2
Re: [PATCH v3 06/12] iio: gyro: Remove redundant pm_runtime_mark_last_busy() calls
Quoted 8 lines · On Mon, 25 Aug 2025 16:53:55 +0300 Sakari Ailus <[email protected]>…
pm_runtime_put_autosuspend(),pm_runtime_put_sync_autosuspend(),pm_runtime_autosuspend()andpm_request_autosuspend()now include a call topm_runtime_mark_last_busy(). Remove the now-reduntant explicit call topm_runtime_mark_last_busy().Signed-off-by Sakari Ailus <[email protected]>Reviewed-by Linus Walleij <[email protected]>Reviewed-by Rui Miguel Silva <[email protected]>
Applied.
PATCH v3 7/12 iio: imu: Remove redundant pm_runtime_mark_last_busy() calls
In reply to Sakari Ailuspm_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().
--- drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c | 5 ----- drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c | 1 - drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c | 5 ----- drivers/iio/imu/inv_icm42600/inv_icm42600_temp.c | 1 - drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 6 ------ drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c | 1 - drivers/iio/imu/kmx61.c | 6 ++---- 7 files changed, 2 insertions(+), 23 deletions(-)
drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c +0 -5
@@ -315,7 +315,6 @@ static int inv_icm42600_accel_read_sensor(struct iio_dev *indio_dev, ret = -EINVAL ; exit:mutex_unlock (&st->lock); -pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);return ret; }
@@ -567,7 +566,6 @@ static int inv_icm42600_accel_write_scale(struct iio_dev *indio_dev, ret =inv_icm42600_set_accel_conf (st, &conf,NULL );mutex_unlock (&st->lock); -pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);return ret;
@@ -675,7 +673,6 @@ static int inv_icm42600_accel_write_odr(struct iio_dev *indio_dev, out_unlock:mutex_unlock (&st->lock); -pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);return ret;
@@ -727,7 +724,6 @@ static int inv_icm42600_accel_read_offset(struct inv_icm42600_state *st,memcpy (data, st->buffer,sizeof (data));mutex_unlock (&st->lock); -pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);if (ret)return ret;
@@ -865,7 +861,6 @@ static int inv_icm42600_accel_write_offset(struct inv_icm42600_state *st, out_unlock:mutex_unlock (&st->lock); -pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);return ret; }
drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c +0 -1
@@ -430,7 +430,6 @@ static int inv_icm42600_buffer_postdisable(struct iio_dev *indio_dev)if (sleep)msleep (sleep); -pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);return ret;
drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c +0 -5
@@ -184,7 +184,6 @@ static int inv_icm42600_gyro_read_sensor(struct inv_icm42600_state *st, ret = -EINVAL ; exit:mutex_unlock (&st->lock); -pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);return ret; }
@@ -283,7 +282,6 @@ static int inv_icm42600_gyro_write_scale(struct iio_dev *indio_dev, ret =inv_icm42600_set_gyro_conf (st, &conf,NULL );mutex_unlock (&st->lock); -pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);return ret;
@@ -378,7 +376,6 @@ static int inv_icm42600_gyro_write_odr(struct iio_dev *indio_dev, out_unlock:mutex_unlock (&st->lock); -pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);return ret;
@@ -430,7 +427,6 @@ static int inv_icm42600_gyro_read_offset(struct inv_icm42600_state *st,memcpy (data, st->buffer,sizeof (data));mutex_unlock (&st->lock); -pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);if (ret)return ret;
@@ -567,7 +563,6 @@ static int inv_icm42600_gyro_write_offset(struct inv_icm42600_state *st, out_unlock:mutex_unlock (&st->lock); -pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);return ret; }
drivers/iio/imu/inv_icm42600/inv_icm42600_temp.c +0 -1
@@ -41,7 +41,6 @@ static int inv_icm42600_temp_read(struct inv_icm42600_state *st, s16 *temp) exit:mutex_unlock (&st->lock); -pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);return ret;
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +0 -6
@@ -735,7 +735,6 @@ static int inv_mpu6050_read_channel_data(struct iio_dev *indio_dev,break ; } -pm_runtime_mark_last_busy (pdev);pm_runtime_put_autosuspend (pdev);return ret;
@@ -938,7 +937,6 @@ static int inv_mpu6050_write_raw(struct iio_dev *indio_dev,break ; } -pm_runtime_mark_last_busy (pdev);pm_runtime_put_autosuspend (pdev); error_write_raw_unlock:mutex_unlock (&st->lock);
@@ -1146,14 +1144,12 @@ static int inv_mpu6050_enable_wom(struct inv_mpu6050_state *st, bool en) st->chip_config.wom_en = false; } -pm_runtime_mark_last_busy (pdev);pm_runtime_put_autosuspend (pdev); }return result; error_suspend: -pm_runtime_mark_last_busy (pdev);pm_runtime_put_autosuspend (pdev);return result; }
@@ -1249,7 +1245,6 @@ static int inv_mpu6050_write_event_value(struct iio_dev *indio_dev, value = (u64 )val *1000000ULL + (u64 )val2; result =inv_mpu6050_set_wom_threshold (st, value,INV_MPU6050_FREQ_DIVIDER (st)); -pm_runtime_mark_last_busy (pdev);pm_runtime_put_autosuspend (pdev);return result;
@@ -1357,7 +1352,6 @@ inv_mpu6050_fifo_rate_store(struct device *dev, struct device_attribute *attr,if (result) goto fifo_rate_fail_power_off; -pm_runtime_mark_last_busy (pdev); fifo_rate_fail_power_off:pm_runtime_put_autosuspend (pdev); fifo_rate_fail_unlock:
drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c +0 -1
@@ -194,7 +194,6 @@ static int inv_mpu6050_set_enable(struct iio_dev *indio_dev, bool enable) result =inv_mpu6050_prepare_fifo (st, false);if (result) goto error_power_off; -pm_runtime_mark_last_busy (pdev);pm_runtime_put_autosuspend (pdev); }
drivers/iio/imu/kmx61.c +2 -4
@@ -747,12 +747,10 @@ static int kmx61_set_power_state(struct kmx61_data *data, bool on, u8 device) data->mag_ps = on; } -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: kmx61_set_power_state for %d, ret %d\n",
Signature · 1 line
2.47.2
Re: [PATCH v3 07/12] iio: imu: Remove redundant pm_runtime_mark_last_busy() calls
Quoted 6 lines · On Mon, 25 Aug 2025 16:53:56 +0300 Sakari Ailus <[email protected]>…
pm_runtime_put_autosuspend(),pm_runtime_put_sync_autosuspend(),pm_runtime_autosuspend()andpm_request_autosuspend()now include a call topm_runtime_mark_last_busy(). Remove the now-reduntant explicit call topm_runtime_mark_last_busy().Signed-off-by Sakari Ailus <[email protected]>
Applied.
Thanks,
PATCH v3 8/12 iio: light: Remove redundant pm_runtime_mark_last_busy() calls
In reply to Sakari Ailuspm_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().
--- drivers/iio/light/apds9306.c | 2 -- drivers/iio/light/apds9960.c | 1 - drivers/iio/light/bh1780.c | 1 - drivers/iio/light/gp2ap002.c | 2 -- drivers/iio/light/isl29028.c | 11 +++-------- drivers/iio/light/ltrf216a.c | 1 - drivers/iio/light/pa12203001.c | 11 +++-------- drivers/iio/light/rpr0521.c | 6 ++---- drivers/iio/light/tsl2583.c | 12 +++--------- drivers/iio/light/tsl2591.c | 2 -- drivers/iio/light/us5182d.c | 12 +++--------- drivers/iio/light/vcnl4000.c | 11 +++-------- drivers/iio/light/vcnl4035.c | 11 +++-------- 13 files changed, 20 insertions(+), 63 deletions(-)
drivers/iio/light/apds9306.c +0 -2
@@ -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 ;
drivers/iio/light/apds9960.c +0 -1
@@ -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); }
drivers/iio/light/bh1780.c +0 -1
@@ -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;
drivers/iio/light/gp2ap002.c +0 -2
@@ -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; }
drivers/iio/light/isl29028.c +3 -8
@@ -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 */
drivers/iio/light/ltrf216a.c +0 -1
@@ -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); }
drivers/iio/light/pa12203001.c +3 -8
@@ -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);
drivers/iio/light/rpr0521.c +2 -4
@@ -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",
drivers/iio/light/tsl2583.c +3 -9
@@ -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,
drivers/iio/light/tsl2591.c +0 -2
@@ -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); }
drivers/iio/light/us5182d.c +3 -9
@@ -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,
drivers/iio/light/vcnl4000.c +3 -8
@@ -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)
drivers/iio/light/vcnl4035.c +3 -8
@@ -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,
Signature · 1 line
2.47.2
Jonathan Cameron
maintainerRe: [PATCH v3 08/12] iio: light: Remove redundant pm_runtime_mark_last_busy() calls
Quoted 7 lines · On Mon, 25 Aug 2025 16:53:57 +0300 Sakari Ailus <[email protected]>…
pm_runtime_put_autosuspend(),pm_runtime_put_sync_autosuspend(),pm_runtime_autosuspend()andpm_request_autosuspend()now include a call topm_runtime_mark_last_busy(). Remove the now-reduntant explicit call topm_runtime_mark_last_busy().Signed-off-by Sakari Ailus <[email protected]>Reviewed-by Linus Walleij <[email protected]>
Hi Sakari,
I'm going to apply this as it stands, but there has been a lot of cut and paste in these drivers, so a common pattern is to have a no entirely pointless power(bool enable) function. Previously it at least wrapped up 2 calls, now it is doing a choice between two single line calls so makes no sense.
Anyhow, if anyone wants to clean these up that would be great. In meantime I'd rather not leave cases of the pm_runtime_mark_last_busy() around to get pasted into more drivers.
So applied,
Jonathan
drivers/iio/light/isl29028.c static int isl29028_ir_get(struct isl29028_chip *chip, int *ir_data) · line 338
Quoted 8 lines
drivers/iio/light/isl29028.c +0
-0@@ -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);
As below.
Quoted 21 lines
drivers/iio/light/isl29028.c +3
-8-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); }drivers/iio/light/tsl2583.c +0
-0
drivers/iio/light/tsl2583.c static const struct iio_chan_spec tsl2583_channels[] = { · line 643
Quoted 3 lines
drivers/iio/light/tsl2583.c +0
-0@@ -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) {
As below.
Quoted 20 lines
drivers/iio/light/tsl2583.c +3
-9-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); }drivers/iio/light/us5182d.c +0
-0
drivers/iio/light/us5182d.c static int us5182d_shutdown_en(struct us5182d_data *data, u8 state) · line 362
Quoted 2 lines
drivers/iio/light/us5182d.c +0
-0@@ -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)
As below.
Quoted 25 lines
drivers/iio/light/us5182d.c +3
-9{ -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,drivers/iio/light/vcnl4000.c +0
-0
drivers/iio/light/vcnl4000.c static bool vcnl4010_is_in_periodic_mode(struct vcnl4000_data *data) · line 576
Quoted 1 line
drivers/iio/light/vcnl4000.c +0
-0@@ -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)
As below.
Quoted 23 lines
drivers/iio/light/vcnl4000.c +3
-8{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)drivers/iio/light/vcnl4035.c +0
-0
drivers/iio/light/vcnl4035.c static const struct iio_trigger_ops vcnl4035_trigger_ops = { · line 142
Quoted 2 lines
drivers/iio/light/vcnl4035.c +0
-0@@ -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)
I'd like to get rid of this function. It was of marginal benefit before it got even simpler, not it is actively making the code worse to read.
Quoted 18 lines
drivers/iio/light/vcnl4035.c +3
-8{ -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,
PATCH v3 9/12 iio: magnetometer: Remove redundant pm_runtime_mark_last_busy() calls
In reply to Sakari Ailuspm_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().
--- drivers/iio/magnetometer/ak8974.c | 2 -- drivers/iio/magnetometer/ak8975.c | 1 - drivers/iio/magnetometer/als31300.c | 2 -- drivers/iio/magnetometer/bmc150_magn.c | 13 ++++--------- drivers/iio/magnetometer/tmag5273.c | 2 -- drivers/iio/magnetometer/yamaha-yas530.c | 2 -- 6 files changed, 4 insertions(+), 18 deletions(-)
drivers/iio/magnetometer/ak8974.c +0 -2
@@ -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); }
drivers/iio/magnetometer/ak8975.c +0 -1
@@ -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. */
drivers/iio/magnetometer/als31300.c +0 -2
@@ -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);
drivers/iio/magnetometer/bmc150_magn.c +4 -9
@@ -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 ; }
drivers/iio/magnetometer/tmag5273.c +0 -2
@@ -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);
drivers/iio/magnetometer/yamaha-yas530.c +0 -2
@@ -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" );
Signature · 1 line
2.47.2
Re: [PATCH v3 09/12] iio: magnetometer: Remove redundant pm_runtime_mark_last_busy() calls
Quoted 10 lines · On Mon, 25 Aug 2025 16:53:58 +0300 Sakari Ailus <[email protected]>…
pm_runtime_put_autosuspend(),pm_runtime_put_sync_autosuspend(),pm_runtime_autosuspend()andpm_request_autosuspend()now include a call topm_runtime_mark_last_busy(). Remove the now-reduntant explicit call topm_runtime_mark_last_busy().Also drop checking for errors on
pm_runtime_put_autosuspend()inbmc150_magn_set_power_state().Signed-off-by Sakari Ailus <[email protected]>Reviewed-by Linus Walleij <[email protected]>
One comment inline, but similar to the light sensors, I think it still makes sense to take this patch now.
Applied
Thanks,
Jonathan
drivers/iio/magnetometer/bmc150_magn.c static int bmc150_magn_set_power_mode(struct bmc150_magn_data *data, · line 259
Quoted 8 lines
drivers/iio/magnetometer/bmc150_magn.c +0
-0@@ -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) {
This is another 'helper' that should probably go away in the longer term.
Quoted 23 lines
drivers/iio/magnetometer/bmc150_magn.c +4
-9-#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 ; }
PATCH v3 10/12 iio: pressure: Remove redundant pm_runtime_mark_last_busy() calls
In reply to Sakari Ailuspm_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().
--- drivers/iio/pressure/bmp280-core.c | 5 ----- drivers/iio/pressure/icp10100.c | 1 - drivers/iio/pressure/mpl115.c | 2 -- drivers/iio/pressure/zpa2326.c | 2 -- 4 files changed, 10 deletions(-)
drivers/iio/pressure/bmp280-core.c +0 -5
@@ -752,7 +752,6 @@ static int bmp280_read_raw(struct iio_dev *indio_dev,pm_runtime_get_sync (data->dev); ret =bmp280_read_raw_impl (indio_dev, chan, val, val2, mask); -pm_runtime_mark_last_busy (data->dev);pm_runtime_put_autosuspend (data->dev);return ret;
@@ -927,7 +926,6 @@ static int bmp280_write_raw(struct iio_dev *indio_dev,pm_runtime_get_sync (data->dev); ret =bmp280_write_raw_impl (indio_dev, chan, val, val2, mask); -pm_runtime_mark_last_busy (data->dev);pm_runtime_put_autosuspend (data->dev);return ret;
@@ -2255,7 +2253,6 @@ static int bmp580_nvmem_read(void *priv, unsigned int offset, void *val,pm_runtime_get_sync (data->dev); ret =bmp580_nvmem_read_impl (priv, offset, val, bytes); -pm_runtime_mark_last_busy (data->dev);pm_runtime_put_autosuspend (data->dev);return ret;
@@ -2330,7 +2327,6 @@ static int bmp580_nvmem_write(void *priv, unsigned int offset, void *val,pm_runtime_get_sync (data->dev); ret =bmp580_nvmem_write_impl (priv, offset, val, bytes); -pm_runtime_mark_last_busy (data->dev);pm_runtime_put_autosuspend (data->dev);return ret;
@@ -3120,7 +3116,6 @@ static int bmp280_buffer_postdisable(struct iio_dev *indio_dev) {struct bmp280_data *data =iio_priv (indio_dev); -pm_runtime_mark_last_busy (data->dev);pm_runtime_put_autosuspend (data->dev);return 0 ;
drivers/iio/pressure/icp10100.c +0 -1
@@ -265,7 +265,6 @@ static int icp10100_get_measures(struct icp10100_state *st, (be16_to_cpu (measures[1 ]) >>8 ); *temperature =be16_to_cpu (measures[2 ]); -pm_runtime_mark_last_busy (&st->client->dev); error_measure:pm_runtime_put_autosuspend (&st->client->dev);return ret;
drivers/iio/pressure/mpl115.c +0 -2
@@ -108,7 +108,6 @@ static int mpl115_read_raw(struct iio_dev *indio_dev, ret =mpl115_comp_pressure (data, val, val2);if (ret <0 )return ret; -pm_runtime_mark_last_busy (data->dev);pm_runtime_put_autosuspend (data->dev);return IIO_VAL_INT_PLUS_MICRO ;
@@ -118,7 +117,6 @@ static int mpl115_read_raw(struct iio_dev *indio_dev, ret =mpl115_read_temp (data);if (ret <0 )return ret; -pm_runtime_mark_last_busy (data->dev);pm_runtime_put_autosuspend (data->dev); *val = ret >>6 ;
drivers/iio/pressure/zpa2326.c +0 -2
@@ -697,7 +697,6 @@ static void zpa2326_suspend(struct iio_dev *indio_dev)zpa2326_sleep (indio_dev); -pm_runtime_mark_last_busy (parent);pm_runtime_put_autosuspend (parent); }
@@ -708,7 +707,6 @@ static void zpa2326_init_runtime(struct device *parent)pm_runtime_enable (parent);pm_runtime_set_autosuspend_delay (parent,1000 );pm_runtime_use_autosuspend (parent); -pm_runtime_mark_last_busy (parent);pm_runtime_put_autosuspend (parent); }
Signature · 1 line
2.47.2
Re: [PATCH v3 10/12] iio: pressure: Remove redundant pm_runtime_mark_last_busy() calls
Quoted 6 lines · On Mon, 25 Aug 2025 16:53:59 +0300 Sakari Ailus <[email protected]>…
pm_runtime_put_autosuspend(),pm_runtime_put_sync_autosuspend(),pm_runtime_autosuspend()andpm_request_autosuspend()now include a call topm_runtime_mark_last_busy(). Remove the now-reduntant explicit call topm_runtime_mark_last_busy().Signed-off-by Sakari Ailus <[email protected]>
Applied.
PATCH v3 11/12 iio: proximity: Remove redundant pm_runtime_mark_last_busy() calls
In reply to Sakari Ailuspm_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().
--- drivers/iio/proximity/pulsedlight-lidar-lite-v2.c | 1 - drivers/iio/proximity/srf04.c | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-)
drivers/iio/proximity/pulsedlight-lidar-lite-v2.c +0 -1
@@ -185,7 +185,6 @@ static int lidar_get_measurement(struct lidar_data *data, u16 *reg) } ret = -EIO ; } -pm_runtime_mark_last_busy (&client->dev);pm_runtime_put_autosuspend (&client->dev);return ret;
drivers/iio/proximity/srf04.c +1 -3
@@ -117,10 +117,8 @@ static int srf04_read(struct srf04_data *data)udelay (data->cfg->trigger_pulse_us);gpiod_set_value (data->gpiod_trig,0 ); -if (data->gpiod_power) { -pm_runtime_mark_last_busy (data->dev); +if (data->gpiod_power)pm_runtime_put_autosuspend (data->dev); - }/* it should not take more than 20 ms until echo is rising */ ret =wait_for_completion_killable_timeout (&data->rising,HZ /50 );
Signature · 1 line
2.47.2
Re: [PATCH v3 11/12] iio: proximity: Remove redundant pm_runtime_mark_last_busy() calls
Quoted 6 lines · On Mon, 25 Aug 2025 16:54:00 +0300 Sakari Ailus <[email protected]>…
pm_runtime_put_autosuspend(),pm_runtime_put_sync_autosuspend(),pm_runtime_autosuspend()andpm_request_autosuspend()now include a call topm_runtime_mark_last_busy(). Remove the now-reduntant explicit call topm_runtime_mark_last_busy().Signed-off-by Sakari Ailus <[email protected]>
Applied,
PATCH v3 12/12 iio: temperature: Remove redundant pm_runtime_mark_last_busy() calls
In reply to Sakari Ailuspm_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().
--- drivers/iio/temperature/mlx90614.c | 1 - drivers/iio/temperature/mlx90632.c | 1 - drivers/iio/temperature/mlx90635.c | 1 - 3 files changed, 3 deletions(-)
drivers/iio/temperature/mlx90614.c +0 -1
@@ -225,7 +225,6 @@ static void mlx90614_power_put(struct mlx90614_data *data)if (!data->wakeup_gpio)return ; -pm_runtime_mark_last_busy (&data->client->dev); pm_runtime_put_autosuspend(&data->client->dev); }#else
drivers/iio/temperature/mlx90632.c +0 -1
@@ -1043,7 +1043,6 @@ static int mlx90632_read_raw(struct iio_dev *indio_dev, } mlx90632_read_raw_pm: -pm_runtime_mark_last_busy (&data->client->dev);pm_runtime_put_autosuspend (&data->client->dev);return ret; }
drivers/iio/temperature/mlx90635.c +0 -1
@@ -749,7 +749,6 @@ static int mlx90635_read_raw(struct iio_dev *indio_dev, } mlx90635_read_raw_pm: -pm_runtime_mark_last_busy (&data->client->dev);pm_runtime_put_autosuspend (&data->client->dev);return ret; }
Signature · 1 line
2.47.2
Re: [PATCH v3 12/12] iio: temperature: Remove redundant pm_runtime_mark_last_busy() calls
Quoted 7 lines · On Mon, 25 Aug 2025 16:54:01 +0300 Sakari Ailus <[email protected]>…
pm_runtime_put_autosuspend(),pm_runtime_put_sync_autosuspend(),pm_runtime_autosuspend()andpm_request_autosuspend()now include a call topm_runtime_mark_last_busy(). Remove the now-reduntant explicit call topm_runtime_mark_last_busy().Signed-off-by Sakari Ailus <[email protected]>Acked-by Crt Mori <[email protected]>
Applied.
thanks
Jonathan