freq_hz = INV_MPU6050_DIVIDER_TO_FIFO_RATE(st->chip_config.divider);
period_us = 1000000 / freq_hz;
- result = pm_runtime_get_sync(pdev);
- if (result < 0) {
- pm_runtime_put_noidle(pdev);
+ result = pm_runtime_resume_and_get(pdev);
+ if (result)
return result;
- }
switch (chan->type) {
case IIO_ANGL_VEL:
return result;
mutex_lock(&st->lock);
- result = pm_runtime_get_sync(pdev);
- if (result < 0) {
- pm_runtime_put_noidle(pdev);
+ result = pm_runtime_resume_and_get(pdev);
+ if (result)
goto error_write_raw_unlock;
- }
switch (mask) {
case IIO_CHAN_INFO_SCALE:
result = 0;
goto fifo_rate_fail_unlock;
}
- result = pm_runtime_get_sync(pdev);
- if (result < 0) {
- pm_runtime_put_noidle(pdev);
+ result = pm_runtime_resume_and_get(pdev);
+ if (result)
goto fifo_rate_fail_unlock;
- }
result = regmap_write(st->map, st->reg->sample_rate_div, d);
if (result)
{
struct device *dev = data;
- pm_runtime_put_sync_suspend(dev);
pm_runtime_disable(dev);
}
if (enable) {
scan = inv_scan_query(indio_dev);
- result = pm_runtime_get_sync(pdev);
- if (result < 0) {
- pm_runtime_put_noidle(pdev);
+ result = pm_runtime_resume_and_get(pdev);
+ if (result)
return result;
- }
/*
* In case autosuspend didn't trigger, turn off first not
* required sensors.