Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Sakari Ailus and committed by
Jonathan Cameron
e15f23dd 00a3c4be

+20 -63
-2
drivers/iio/light/apds9306.c
··· 537 537 538 538 *val = get_unaligned_le24(&buff); 539 539 540 - pm_runtime_mark_last_busy(data->dev); 541 540 pm_runtime_put_autosuspend(data->dev); 542 541 543 542 return 0; ··· 1120 1121 if (ret) 1121 1122 return ret; 1122 1123 1123 - pm_runtime_mark_last_busy(data->dev); 1124 1124 pm_runtime_put_autosuspend(data->dev); 1125 1125 1126 1126 return 0;
-1
drivers/iio/light/apds9960.c
··· 495 495 usleep_range(data->als_adc_int_us, 496 496 APDS9960_MAX_INT_TIME_IN_US); 497 497 } else { 498 - pm_runtime_mark_last_busy(dev); 499 498 ret = pm_runtime_put_autosuspend(dev); 500 499 } 501 500
-1
drivers/iio/light/bh1780.c
··· 111 111 value = bh1780_read_word(bh1780, BH1780_REG_DLOW); 112 112 if (value < 0) 113 113 return value; 114 - pm_runtime_mark_last_busy(&bh1780->client->dev); 115 114 pm_runtime_put_autosuspend(&bh1780->client->dev); 116 115 *val = value; 117 116
-2
drivers/iio/light/gp2ap002.c
··· 271 271 } 272 272 273 273 out: 274 - pm_runtime_mark_last_busy(gp2ap002->dev); 275 274 pm_runtime_put_autosuspend(gp2ap002->dev); 276 275 277 276 return ret; ··· 352 353 pm_runtime_get_sync(gp2ap002->dev); 353 354 gp2ap002->enabled = true; 354 355 } else { 355 - pm_runtime_mark_last_busy(gp2ap002->dev); 356 356 pm_runtime_put_autosuspend(gp2ap002->dev); 357 357 gp2ap002->enabled = false; 358 358 }
+3 -8
drivers/iio/light/isl29028.c
··· 336 336 static int isl29028_set_pm_runtime_busy(struct isl29028_chip *chip, bool on) 337 337 { 338 338 struct device *dev = regmap_get_device(chip->regmap); 339 - int ret; 340 339 341 - if (on) { 342 - ret = pm_runtime_resume_and_get(dev); 343 - } else { 344 - pm_runtime_mark_last_busy(dev); 345 - ret = pm_runtime_put_autosuspend(dev); 346 - } 340 + if (on) 341 + return pm_runtime_resume_and_get(dev); 347 342 348 - return ret; 343 + return pm_runtime_put_autosuspend(dev); 349 344 } 350 345 351 346 /* Channel IO */
-1
drivers/iio/light/ltrf216a.c
··· 208 208 return ret; 209 209 } 210 210 } else { 211 - pm_runtime_mark_last_busy(dev); 212 211 pm_runtime_put_autosuspend(dev); 213 212 } 214 213
+3 -8
drivers/iio/light/pa12203001.c
··· 185 185 mutex_unlock(&data->lock); 186 186 } 187 187 188 - if (on) { 189 - ret = pm_runtime_resume_and_get(&data->client->dev); 188 + if (on) 189 + return pm_runtime_resume_and_get(&data->client->dev); 190 190 191 - } else { 192 - pm_runtime_mark_last_busy(&data->client->dev); 193 - ret = pm_runtime_put_autosuspend(&data->client->dev); 194 - } 195 - 196 - return ret; 191 + return pm_runtime_put_autosuspend(&data->client->dev); 197 192 198 193 err: 199 194 mutex_unlock(&data->lock);
+2 -4
drivers/iio/light/rpr0521.c
··· 358 358 * Note: If either measurement is re-enabled before _suspend(), 359 359 * both stay enabled until _suspend(). 360 360 */ 361 - if (on) { 361 + if (on) 362 362 ret = pm_runtime_resume_and_get(&data->client->dev); 363 - } else { 364 - pm_runtime_mark_last_busy(&data->client->dev); 363 + else 365 364 ret = pm_runtime_put_autosuspend(&data->client->dev); 366 - } 367 365 if (ret < 0) { 368 366 dev_err(&data->client->dev, 369 367 "Failed: rpr0521_set_power_state for %d, ret %d\n",
+3 -9
drivers/iio/light/tsl2583.c
··· 641 641 642 642 static int tsl2583_set_pm_runtime_busy(struct tsl2583_chip *chip, bool on) 643 643 { 644 - int ret; 644 + if (on) 645 + return pm_runtime_resume_and_get(&chip->client->dev); 645 646 646 - if (on) { 647 - ret = pm_runtime_resume_and_get(&chip->client->dev); 648 - } else { 649 - pm_runtime_mark_last_busy(&chip->client->dev); 650 - ret = pm_runtime_put_autosuspend(&chip->client->dev); 651 - } 652 - 653 - return ret; 647 + return pm_runtime_put_autosuspend(&chip->client->dev); 654 648 } 655 649 656 650 static int tsl2583_read_raw(struct iio_dev *indio_dev,
-2
drivers/iio/light/tsl2591.c
··· 772 772 err_unlock: 773 773 mutex_unlock(&chip->als_mutex); 774 774 775 - pm_runtime_mark_last_busy(&client->dev); 776 775 pm_runtime_put_autosuspend(&client->dev); 777 776 778 777 return ret; ··· 994 995 pm_runtime_get_sync(&client->dev); 995 996 } else if (!state && chip->events_enabled) { 996 997 chip->events_enabled = false; 997 - pm_runtime_mark_last_busy(&client->dev); 998 998 pm_runtime_put_autosuspend(&client->dev); 999 999 } 1000 1000
+3 -9
drivers/iio/light/us5182d.c
··· 361 361 362 362 static int us5182d_set_power_state(struct us5182d_data *data, bool on) 363 363 { 364 - int ret; 365 - 366 364 if (data->power_mode == US5182D_ONESHOT) 367 365 return 0; 368 366 369 - if (on) { 370 - ret = pm_runtime_resume_and_get(&data->client->dev); 371 - } else { 372 - pm_runtime_mark_last_busy(&data->client->dev); 373 - ret = pm_runtime_put_autosuspend(&data->client->dev); 374 - } 367 + if (on) 368 + return pm_runtime_resume_and_get(&data->client->dev); 375 369 376 - return ret; 370 + return pm_runtime_put_autosuspend(&data->client->dev); 377 371 } 378 372 379 373 static int us5182d_read_value(struct us5182d_data *data,
+3 -8
drivers/iio/light/vcnl4000.c
··· 576 576 static int vcnl4000_set_pm_runtime_state(struct vcnl4000_data *data, bool on) 577 577 { 578 578 struct device *dev = &data->client->dev; 579 - int ret; 580 579 581 - if (on) { 582 - ret = pm_runtime_resume_and_get(dev); 583 - } else { 584 - pm_runtime_mark_last_busy(dev); 585 - ret = pm_runtime_put_autosuspend(dev); 586 - } 580 + if (on) 581 + return pm_runtime_resume_and_get(dev); 587 582 588 - return ret; 583 + return pm_runtime_put_autosuspend(dev); 589 584 } 590 585 591 586 static int vcnl4040_read_als_it(struct vcnl4000_data *data, int *val, int *val2)
+3 -8
drivers/iio/light/vcnl4035.c
··· 141 141 142 142 static int vcnl4035_set_pm_runtime_state(struct vcnl4035_data *data, bool on) 143 143 { 144 - int ret; 145 144 struct device *dev = &data->client->dev; 146 145 147 - if (on) { 148 - ret = pm_runtime_resume_and_get(dev); 149 - } else { 150 - pm_runtime_mark_last_busy(dev); 151 - ret = pm_runtime_put_autosuspend(dev); 152 - } 146 + if (on) 147 + return pm_runtime_resume_and_get(dev); 153 148 154 - return ret; 149 + return pm_runtime_put_autosuspend(dev); 155 150 } 156 151 157 152 static int vcnl4035_read_info_raw(struct iio_dev *indio_dev,