diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2023-09-14 20:20:54 +0300 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2023-09-27 10:39:57 +0300 |
commit | b92f8f3591aca18fe677092fcc567c698368f651 (patch) | |
tree | e0161c44a78b1c014f8cbc0a819689a7d67be2dd /drivers/media/i2c/imx208.c | |
parent | 20290feaaeb76cc719921aad275ccb18662a7c3a (diff) | |
download | linux-b92f8f3591aca18fe677092fcc567c698368f651.tar.xz |
media: i2c: Use pm_runtime_resume_and_get()
Simplify error handling by using pm_runtime_resume_and_get() instead of
pm_runtime_get_sync() with a put call in the error path.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com> (st-vgxy61)
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media/i2c/imx208.c')
-rw-r--r-- | drivers/media/i2c/imx208.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/media/i2c/imx208.c b/drivers/media/i2c/imx208.c index ee5a28675388..a6edcae4ef47 100644 --- a/drivers/media/i2c/imx208.c +++ b/drivers/media/i2c/imx208.c @@ -720,9 +720,11 @@ static int imx208_set_stream(struct v4l2_subdev *sd, int enable) } if (enable) { - ret = pm_runtime_get_sync(&client->dev); - if (ret < 0) - goto err_rpm_put; + ret = pm_runtime_resume_and_get(&client->dev); + if (ret) { + mutex_unlock(&imx208->imx208_mx); + return ret; + } /* * Apply default & customized values @@ -819,11 +821,9 @@ static int imx208_read_otp(struct imx208 *imx208) if (imx208->otp_read) goto out_unlock; - 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) goto out_unlock; - } ret = imx208_identify_module(imx208); if (ret) |