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: magnetometer: 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().

Also drop checking for errors on pm_runtime_put_autosuspend() in
bmc150_magn_set_power_state().

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-10-sakari.ailus@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Sakari Ailus and committed by
Jonathan Cameron
e3c3e495 e15f23dd

+4 -18
-2
drivers/iio/magnetometer/ak8974.c
··· 583 583 *val = (s16)le16_to_cpu(hw_values[address]); 584 584 out_unlock: 585 585 mutex_unlock(&ak8974->lock); 586 - pm_runtime_mark_last_busy(&ak8974->i2c->dev); 587 586 pm_runtime_put_autosuspend(&ak8974->i2c->dev); 588 587 589 588 return ret; ··· 677 678 678 679 out_unlock: 679 680 mutex_unlock(&ak8974->lock); 680 - pm_runtime_mark_last_busy(&ak8974->i2c->dev); 681 681 pm_runtime_put_autosuspend(&ak8974->i2c->dev); 682 682 } 683 683
-1
drivers/iio/magnetometer/ak8975.c
··· 775 775 776 776 mutex_unlock(&data->lock); 777 777 778 - pm_runtime_mark_last_busy(&data->client->dev); 779 778 pm_runtime_put_autosuspend(&data->client->dev); 780 779 781 780 /* Swap bytes and convert to valid range. */
-2
drivers/iio/magnetometer/als31300.c
··· 140 140 *z = ALS31300_DATA_Z_GET(buf); 141 141 142 142 out: 143 - pm_runtime_mark_last_busy(data->dev); 144 143 pm_runtime_put_autosuspend(data->dev); 145 144 146 145 return ret; ··· 400 401 pm_runtime_set_autosuspend_delay(dev, 200); 401 402 pm_runtime_use_autosuspend(dev); 402 403 403 - pm_runtime_mark_last_busy(dev); 404 404 pm_runtime_put_autosuspend(dev); 405 405 406 406 ret = devm_iio_device_register(dev, indio_dev);
+4 -9
drivers/iio/magnetometer/bmc150_magn.c
··· 257 257 258 258 static int bmc150_magn_set_power_state(struct bmc150_magn_data *data, bool on) 259 259 { 260 - #ifdef CONFIG_PM 261 - int ret; 260 + int ret = 0; 262 261 263 - if (on) { 262 + if (on) 264 263 ret = pm_runtime_resume_and_get(data->dev); 265 - } else { 266 - pm_runtime_mark_last_busy(data->dev); 267 - ret = pm_runtime_put_autosuspend(data->dev); 268 - } 269 - 264 + else 265 + pm_runtime_put_autosuspend(data->dev); 270 266 if (ret < 0) { 271 267 dev_err(data->dev, 272 268 "failed to change power state to %d\n", on); 273 269 return ret; 274 270 } 275 - #endif 276 271 277 272 return 0; 278 273 }
-2
drivers/iio/magnetometer/tmag5273.c
··· 295 295 296 296 ret = tmag5273_get_measure(data, &t, &x, &y, &z, &angle, &magnitude); 297 297 298 - pm_runtime_mark_last_busy(data->dev); 299 298 pm_runtime_put_autosuspend(data->dev); 300 299 301 300 if (ret) ··· 667 668 indio_dev->channels = tmag5273_channels; 668 669 indio_dev->num_channels = ARRAY_SIZE(tmag5273_channels); 669 670 670 - pm_runtime_mark_last_busy(dev); 671 671 pm_runtime_put_autosuspend(dev); 672 672 673 673 ret = devm_iio_device_register(dev, indio_dev);
-2
drivers/iio/magnetometer/yamaha-yas530.c
··· 623 623 case IIO_CHAN_INFO_RAW: 624 624 pm_runtime_get_sync(yas5xx->dev); 625 625 ret = ci->get_measure(yas5xx, &t, &x, &y, &z); 626 - pm_runtime_mark_last_busy(yas5xx->dev); 627 626 pm_runtime_put_autosuspend(yas5xx->dev); 628 627 if (ret) 629 628 return ret; ··· 663 664 664 665 pm_runtime_get_sync(yas5xx->dev); 665 666 ret = ci->get_measure(yas5xx, &t, &x, &y, &z); 666 - pm_runtime_mark_last_busy(yas5xx->dev); 667 667 pm_runtime_put_autosuspend(yas5xx->dev); 668 668 if (ret) { 669 669 dev_err(yas5xx->dev, "error refilling buffer\n");