aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/media/omap4iss/iss_video.c
diff options
context:
space:
mode:
authorEzequiel Garcia <ezequiel@collabora.com>2020-01-24 21:35:43 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-03-02 15:11:40 +0100
commit8fd390b89cc8ca786bc1b66d8a76512a6068b081 (patch)
treefb5f0c974505a685f67ced9dd9ff1e5c6970c1bb /drivers/staging/media/omap4iss/iss_video.c
parentmedia: usbvision: deprecate driver (diff)
downloadlinux-dev-8fd390b89cc8ca786bc1b66d8a76512a6068b081.tar.xz
linux-dev-8fd390b89cc8ca786bc1b66d8a76512a6068b081.zip
media: Split v4l2_pipeline_pm_use into v4l2_pipeline_pm_{get, put}
Currently, v4l2_pipeline_pm_use() prototype is: int v4l2_pipeline_pm_use(struct media_entity *entity, int use) Where the 'use' argument shall only be set to '1' for enable/power-on, or to '0' for disable/power-off. The integer return is specified as only meaningful when 'use' is set to '1'. Let's enforce this semantic by splitting the function in two: v4l2_pipeline_pm_get and v4l2_pipeline_pm_put. This is done for several reasons. It makes the API easier to use (or harder to misuse). It removes the constraint on the values the 'use' argument shall take. Also, it removes the need to constraint the return value, by making v4l2_pipeline_pm_put void return. And last, it's more consistent with other kernel APIs, such as the runtime pm APIs, which makes the code more symmetric. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging/media/omap4iss/iss_video.c')
-rw-r--r--drivers/staging/media/omap4iss/iss_video.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/media/omap4iss/iss_video.c b/drivers/staging/media/omap4iss/iss_video.c
index bf7e999998c3..66975a37dc85 100644
--- a/drivers/staging/media/omap4iss/iss_video.c
+++ b/drivers/staging/media/omap4iss/iss_video.c
@@ -1111,7 +1111,7 @@ static int iss_video_open(struct file *file)
goto done;
}
- ret = v4l2_pipeline_pm_use(&video->video.entity, 1);
+ ret = v4l2_pipeline_pm_get(&video->video.entity);
if (ret < 0) {
omap4iss_put(video->iss);
goto done;
@@ -1160,7 +1160,7 @@ static int iss_video_release(struct file *file)
/* Disable streaming and free the buffers queue resources. */
iss_video_streamoff(file, vfh, video->type);
- v4l2_pipeline_pm_use(&video->video.entity, 0);
+ v4l2_pipeline_pm_put(&video->video.entity);
/* Release the videobuf2 queue */
vb2_queue_release(&handle->queue);