mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 12:21:22 -05:00
iio: imu: 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(). Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Link: https://patch.msgid.link/20250825135401.1765847-8-sakari.ailus@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
committed by
Jonathan Cameron
parent
4c0a7ad785
commit
00a3c4be1b
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,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;
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user