Skip to content

Commit 3e412a7

Browse files
ribaldaHans Verkuil
authored andcommitted
media: uvcvideo: Move video_device under video_queue
It is more natural that the "struct video_device" belongs to uvc_video_queue instead of uvc_streaming. This is an aesthetic change. No functional change expected. Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans de Goede <hansg@kernel.org> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
1 parent 97b6ff8 commit 3e412a7

5 files changed

Lines changed: 12 additions & 15 deletions

File tree

drivers/media/usb/uvc/uvc_driver.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1954,11 +1954,11 @@ static void uvc_unregister_video(struct uvc_device *dev)
19541954

19551955
list_for_each_entry(stream, &dev->streams, list) {
19561956
/* Nothing to do here, continue. */
1957-
if (!video_is_registered(&stream->vdev))
1957+
if (!video_is_registered(&stream->queue.vdev))
19581958
continue;
19591959

1960-
vb2_video_unregister_device(&stream->vdev);
1961-
vb2_video_unregister_device(&stream->meta.vdev);
1960+
vb2_video_unregister_device(&stream->queue.vdev);
1961+
vb2_video_unregister_device(&stream->meta.queue.vdev);
19621962

19631963
/*
19641964
* Now both vdevs are not streaming and all the ioctls will
@@ -1980,12 +1980,12 @@ static void uvc_unregister_video(struct uvc_device *dev)
19801980

19811981
int uvc_register_video_device(struct uvc_device *dev,
19821982
struct uvc_streaming *stream,
1983-
struct video_device *vdev,
19841983
struct uvc_video_queue *queue,
19851984
enum v4l2_buf_type type,
19861985
const struct v4l2_file_operations *fops,
19871986
const struct v4l2_ioctl_ops *ioctl_ops)
19881987
{
1988+
struct video_device *vdev = &queue->vdev;
19891989
int ret;
19901990

19911991
/* Initialize the video buffers queue. */
@@ -2067,9 +2067,9 @@ static int uvc_register_video(struct uvc_device *dev,
20672067
uvc_debugfs_init_stream(stream);
20682068

20692069
/* Register the device with V4L. */
2070-
return uvc_register_video_device(dev, stream, &stream->vdev,
2071-
&stream->queue, stream->type,
2072-
&uvc_fops, &uvc_ioctl_ops);
2070+
return uvc_register_video_device(dev, stream, &stream->queue,
2071+
stream->type, &uvc_fops,
2072+
&uvc_ioctl_ops);
20732073
}
20742074

20752075
/*
@@ -2105,7 +2105,7 @@ static int uvc_register_terms(struct uvc_device *dev,
21052105
*/
21062106
uvc_meta_register(stream);
21072107

2108-
term->vdev = &stream->vdev;
2108+
term->vdev = &stream->queue.vdev;
21092109
}
21102110

21112111
return 0;

drivers/media/usb/uvc/uvc_metadata.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,11 @@ static int uvc_meta_detect_msxu(struct uvc_device *dev)
226226
int uvc_meta_register(struct uvc_streaming *stream)
227227
{
228228
struct uvc_device *dev = stream->dev;
229-
struct video_device *vdev = &stream->meta.vdev;
230229
struct uvc_video_queue *queue = &stream->meta.queue;
231230

232231
stream->meta.format = V4L2_META_FMT_UVC;
233232

234-
return uvc_register_video_device(dev, stream, vdev, queue,
233+
return uvc_register_video_device(dev, stream, queue,
235234
V4L2_BUF_TYPE_META_CAPTURE,
236235
&uvc_meta_fops, &uvc_meta_ioctl_ops);
237236
}

drivers/media/usb/uvc/uvc_v4l2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ static int uvc_v4l2_open(struct file *file)
576576
if (!handle)
577577
return -ENOMEM;
578578

579-
v4l2_fh_init(&handle->vfh, &stream->vdev);
579+
v4l2_fh_init(&handle->vfh, &stream->queue.vdev);
580580
v4l2_fh_add(&handle->vfh, file);
581581
handle->chain = stream->chain;
582582
handle->stream = stream;

drivers/media/usb/uvc/uvc_video.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1691,7 +1691,7 @@ static void uvc_video_complete(struct urb *urb)
16911691
struct uvc_streaming *stream = uvc_urb->stream;
16921692
struct uvc_video_queue *queue = &stream->queue;
16931693
struct uvc_video_queue *qmeta = &stream->meta.queue;
1694-
struct vb2_queue *vb2_qmeta = stream->meta.vdev.queue;
1694+
struct vb2_queue *vb2_qmeta = stream->meta.queue.vdev.queue;
16951695
struct uvc_buffer *buf = NULL;
16961696
struct uvc_buffer *buf_meta = NULL;
16971697
unsigned long flags;

drivers/media/usb/uvc/uvcvideo.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ struct uvc_buffer {
328328
#define UVC_QUEUE_DISCONNECTED (1 << 0)
329329

330330
struct uvc_video_queue {
331+
struct video_device vdev;
331332
struct vb2_queue queue;
332333
struct mutex mutex; /*
333334
* Serializes vb2_queue and
@@ -450,7 +451,6 @@ struct uvc_urb {
450451
struct uvc_streaming {
451452
struct list_head list;
452453
struct uvc_device *dev;
453-
struct video_device vdev;
454454
struct uvc_video_chain *chain;
455455
atomic_t active;
456456

@@ -477,7 +477,6 @@ struct uvc_streaming {
477477
struct uvc_buffer *meta_buf);
478478

479479
struct {
480-
struct video_device vdev;
481480
struct uvc_video_queue queue;
482481
u32 format;
483482
} meta;
@@ -732,7 +731,6 @@ int uvc_meta_register(struct uvc_streaming *stream);
732731

733732
int uvc_register_video_device(struct uvc_device *dev,
734733
struct uvc_streaming *stream,
735-
struct video_device *vdev,
736734
struct uvc_video_queue *queue,
737735
enum v4l2_buf_type type,
738736
const struct v4l2_file_operations *fops,

0 commit comments

Comments
 (0)