mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 12:21:22 -05:00
iio: light: 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> 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>
This commit is contained in:
committed by
Jonathan Cameron
parent
00a3c4be1b
commit
e15f23dd53
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user