diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2023-09-14 19:20:54 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2023-09-27 09:39:57 +0200 |
commit | b92f8f3591aca18fe677092fcc567c698368f651 (patch) | |
tree | e0161c44a78b1c014f8cbc0a819689a7d67be2dd /drivers/media/i2c/hi847.c | |
parent | media: ov5640: Fix a memory leak when ov5640_probe fails (diff) | |
download | linux-b92f8f3591aca18fe677092fcc567c698368f651.tar.xz linux-b92f8f3591aca18fe677092fcc567c698368f651.zip |
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/hi847.c')
-rw-r--r-- | drivers/media/i2c/hi847.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/media/i2c/hi847.c b/drivers/media/i2c/hi847.c index 32547d7a2659..47aa2cd06e32 100644 --- a/drivers/media/i2c/hi847.c +++ b/drivers/media/i2c/hi847.c @@ -2623,9 +2623,8 @@ static int hi847_set_stream(struct v4l2_subdev *sd, int enable) mutex_lock(&hi847->mutex); 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) { mutex_unlock(&hi847->mutex); return ret; } |