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

iio: accel: mma9551/3: Balance untime pm + use pm_runtime_resume_and_get()

Both these drivers call pm_runtime_put_no_idle() when the reference
count should already be zero as there is no matching get()

Whilst here use pm_runtime_resume_and_get() rather than open coding.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/20210509113354.660190-7-jic23@kernel.org

+1 -5
-1
drivers/iio/accel/mma9551.c
··· 515 515 516 516 pm_runtime_disable(&client->dev); 517 517 pm_runtime_set_suspended(&client->dev); 518 - pm_runtime_put_noidle(&client->dev); 519 518 520 519 mutex_lock(&data->mutex); 521 520 mma9551_set_device_state(data->client, false);
+1 -3
drivers/iio/accel/mma9551_core.c
··· 664 664 int ret; 665 665 666 666 if (on) 667 - ret = pm_runtime_get_sync(&client->dev); 667 + ret = pm_runtime_resume_and_get(&client->dev); 668 668 else { 669 669 pm_runtime_mark_last_busy(&client->dev); 670 670 ret = pm_runtime_put_autosuspend(&client->dev); ··· 673 673 if (ret < 0) { 674 674 dev_err(&client->dev, 675 675 "failed to change power state to %d\n", on); 676 - if (on) 677 - pm_runtime_put_noidle(&client->dev); 678 676 679 677 return ret; 680 678 }
-1
drivers/iio/accel/mma9553.c
··· 1154 1154 1155 1155 pm_runtime_disable(&client->dev); 1156 1156 pm_runtime_set_suspended(&client->dev); 1157 - pm_runtime_put_noidle(&client->dev); 1158 1157 1159 1158 mutex_lock(&data->mutex); 1160 1159 mma9551_set_device_state(data->client, false);