Skip to content

Commit a32d9c4

Browse files
ribaldahverkuil
authored andcommitted
media: uvcvideo: Make power management granular
Now that every ioctl takes care of their power management we can remove the "global" power management. Despite its size, this is a relatively big change. We hope that there are no size effects of it. If there are some specific devices that miss-behave, we can add a small quirk for them. This patch introduces a behavioral change for the uvc "trigger" button. Before the "trigger" button would work as long as userspace has opened /dev/videoX. Now it only works when the camera is actually streaming. We consider that this the most common (if not the only) usecase and therefore we do not think of this as a regression. Reviewed-by: Hans de Goede <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Ricardo Ribalda <[email protected]> Message-ID: <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
1 parent 10acb91 commit a32d9c4

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

drivers/media/usb/uvc/uvc_v4l2.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,6 @@ static int uvc_v4l2_open(struct file *file)
658658
{
659659
struct uvc_streaming *stream;
660660
struct uvc_fh *handle;
661-
int ret = 0;
662661

663662
stream = video_drvdata(file);
664663
uvc_dbg(stream->dev, CALLS, "%s\n", __func__);
@@ -668,12 +667,6 @@ static int uvc_v4l2_open(struct file *file)
668667
if (!handle)
669668
return -ENOMEM;
670669

671-
ret = uvc_pm_get(stream->dev);
672-
if (ret) {
673-
kfree(handle);
674-
return ret;
675-
}
676-
677670
v4l2_fh_init(&handle->vfh, &stream->vdev);
678671
v4l2_fh_add(&handle->vfh);
679672
handle->chain = stream->chain;
@@ -707,7 +700,6 @@ static int uvc_v4l2_release(struct file *file)
707700
kfree(handle);
708701
file->private_data = NULL;
709702

710-
uvc_pm_put(stream->dev);
711703
return 0;
712704
}
713705

0 commit comments

Comments
 (0)