diff options
author | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-04-23 17:19:14 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-05-19 09:51:41 +0200 |
commit | 5f070f4df4fd71230074d154a6fd99c6abe03abb (patch) | |
tree | 8833b3476a0eac655df9d2c097bb94fbf265663b | |
parent | media: i2c: imx319: use pm_runtime_resume_and_get() (diff) | |
download | linux-5f070f4df4fd71230074d154a6fd99c6abe03abb.tar.xz linux-5f070f4df4fd71230074d154a6fd99c6abe03abb.zip |
media: i2c: imx355: use pm_runtime_resume_and_get()
Commit dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter")
added pm_runtime_resume_and_get() in order to automatically handle
dev->power.usage_count decrement on errors.
Use the new API, in order to cleanup the error check logic.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | drivers/media/i2c/imx355.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/i2c/imx355.c b/drivers/media/i2c/imx355.c index ccedcd4c520a..93f13a04439a 100644 --- a/drivers/media/i2c/imx355.c +++ b/drivers/media/i2c/imx355.c @@ -1442,11 +1442,9 @@ static int imx355_set_stream(struct v4l2_subdev *sd, int enable) } if (enable) { - ret = pm_runtime_get_sync(&client->dev); - if (ret < 0) { - pm_runtime_put_noidle(&client->dev); + ret = pm_runtime_resume_and_get(&client->dev); + if (ret < 0) goto err_unlock; - } /* * Apply default & customized values |