summaryrefslogtreecommitdiff
path: root/drivers/media/i2c/ov7251.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2023-09-14 20:20:54 +0300
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2023-09-27 10:39:57 +0300
commitb92f8f3591aca18fe677092fcc567c698368f651 (patch)
treee0161c44a78b1c014f8cbc0a819689a7d67be2dd /drivers/media/i2c/ov7251.c
parent20290feaaeb76cc719921aad275ccb18662a7c3a (diff)
downloadlinux-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/ov7251.c')
-rw-r--r--drivers/media/i2c/ov7251.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/media/i2c/ov7251.c b/drivers/media/i2c/ov7251.c
index 675fb37a6fea..6582cc0e2384 100644
--- a/drivers/media/i2c/ov7251.c
+++ b/drivers/media/i2c/ov7251.c
@@ -1340,9 +1340,11 @@ static int ov7251_s_stream(struct v4l2_subdev *subdev, int enable)
mutex_lock(&ov7251->lock);
if (enable) {
- ret = pm_runtime_get_sync(ov7251->dev);
- if (ret < 0)
- goto err_power_down;
+ ret = pm_runtime_resume_and_get(ov7251->dev);
+ if (ret) {
+ mutex_unlock(&ov7251->lock);
+ return ret;
+ }
ret = ov7251_pll_configure(ov7251);
if (ret) {