Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Ricardo Ribalda and committed by
Hans Verkuil
3e412a7b 97b6ff86

+12 -15
+8 -8
drivers/media/usb/uvc/uvc_driver.c
··· 1954 1954 1955 1955 list_for_each_entry(stream, &dev->streams, list) { 1956 1956 /* Nothing to do here, continue. */ 1957 - if (!video_is_registered(&stream->vdev)) 1957 + if (!video_is_registered(&stream->queue.vdev)) 1958 1958 continue; 1959 1959 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); 1962 1962 1963 1963 /* 1964 1964 * Now both vdevs are not streaming and all the ioctls will ··· 1980 1980 1981 1981 int uvc_register_video_device(struct uvc_device *dev, 1982 1982 struct uvc_streaming *stream, 1983 - struct video_device *vdev, 1984 1983 struct uvc_video_queue *queue, 1985 1984 enum v4l2_buf_type type, 1986 1985 const struct v4l2_file_operations *fops, 1987 1986 const struct v4l2_ioctl_ops *ioctl_ops) 1988 1987 { 1988 + struct video_device *vdev = &queue->vdev; 1989 1989 int ret; 1990 1990 1991 1991 /* Initialize the video buffers queue. */ ··· 2067 2067 uvc_debugfs_init_stream(stream); 2068 2068 2069 2069 /* 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); 2073 2073 } 2074 2074 2075 2075 /* ··· 2105 2105 */ 2106 2106 uvc_meta_register(stream); 2107 2107 2108 - term->vdev = &stream->vdev; 2108 + term->vdev = &stream->queue.vdev; 2109 2109 } 2110 2110 2111 2111 return 0;
+1 -2
drivers/media/usb/uvc/uvc_metadata.c
··· 226 226 int uvc_meta_register(struct uvc_streaming *stream) 227 227 { 228 228 struct uvc_device *dev = stream->dev; 229 - struct video_device *vdev = &stream->meta.vdev; 230 229 struct uvc_video_queue *queue = &stream->meta.queue; 231 230 232 231 stream->meta.format = V4L2_META_FMT_UVC; 233 232 234 - return uvc_register_video_device(dev, stream, vdev, queue, 233 + return uvc_register_video_device(dev, stream, queue, 235 234 V4L2_BUF_TYPE_META_CAPTURE, 236 235 &uvc_meta_fops, &uvc_meta_ioctl_ops); 237 236 }
+1 -1
drivers/media/usb/uvc/uvc_v4l2.c
··· 576 576 if (!handle) 577 577 return -ENOMEM; 578 578 579 - v4l2_fh_init(&handle->vfh, &stream->vdev); 579 + v4l2_fh_init(&handle->vfh, &stream->queue.vdev); 580 580 v4l2_fh_add(&handle->vfh, file); 581 581 handle->chain = stream->chain; 582 582 handle->stream = stream;
+1 -1
drivers/media/usb/uvc/uvc_video.c
··· 1691 1691 struct uvc_streaming *stream = uvc_urb->stream; 1692 1692 struct uvc_video_queue *queue = &stream->queue; 1693 1693 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; 1695 1695 struct uvc_buffer *buf = NULL; 1696 1696 struct uvc_buffer *buf_meta = NULL; 1697 1697 unsigned long flags;
+1 -3
drivers/media/usb/uvc/uvcvideo.h
··· 328 328 #define UVC_QUEUE_DISCONNECTED (1 << 0) 329 329 330 330 struct uvc_video_queue { 331 + struct video_device vdev; 331 332 struct vb2_queue queue; 332 333 struct mutex mutex; /* 333 334 * Serializes vb2_queue and ··· 451 450 struct uvc_streaming { 452 451 struct list_head list; 453 452 struct uvc_device *dev; 454 - struct video_device vdev; 455 453 struct uvc_video_chain *chain; 456 454 atomic_t active; 457 455 ··· 477 477 struct uvc_buffer *meta_buf); 478 478 479 479 struct { 480 - struct video_device vdev; 481 480 struct uvc_video_queue queue; 482 481 u32 format; 483 482 } meta; ··· 731 732 732 733 int uvc_register_video_device(struct uvc_device *dev, 733 734 struct uvc_streaming *stream, 734 - struct video_device *vdev, 735 735 struct uvc_video_queue *queue, 736 736 enum v4l2_buf_type type, 737 737 const struct v4l2_file_operations *fops,