Skip to content

Commit 3609fed

Browse files
ribaldagregkh
authored andcommitted
media: Revert "media: uvcvideo: Set unique vdev name based in type"
commit f66dcb3 upstream. A lot of userspace depends on a descriptive name for vdev. Without this patch, users have a hard time figuring out which camera shall they use for their video conferencing. This reverts commit e3f60e7. Link: https://lore.kernel.org/linux-media/20211207003840.1212374-2-ribalda@chromium.org Cc: <stable@vger.kernel.org> Fixes: e3f60e7 ("media: uvcvideo: Set unique vdev name based in type") Reported-by: Nicolas Dufresne <nicolas@ndufresne.ca> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 9b3c761 commit 3609fed

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

‎drivers/media/usb/uvc/uvc_driver.c‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2065,7 +2065,6 @@ int uvc_register_video_device(struct uvc_device *dev,
20652065
const struct v4l2_file_operations *fops,
20662066
const struct v4l2_ioctl_ops *ioctl_ops)
20672067
{
2068-
const char *name;
20692068
int ret;
20702069

20712070
/* Initialize the video buffers queue. */
@@ -2094,20 +2093,16 @@ int uvc_register_video_device(struct uvc_device *dev,
20942093
case V4L2_BUF_TYPE_VIDEO_CAPTURE:
20952094
default:
20962095
vdev->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
2097-
name = "Video Capture";
20982096
break;
20992097
case V4L2_BUF_TYPE_VIDEO_OUTPUT:
21002098
vdev->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
2101-
name = "Video Output";
21022099
break;
21032100
case V4L2_BUF_TYPE_META_CAPTURE:
21042101
vdev->device_caps = V4L2_CAP_META_CAPTURE | V4L2_CAP_STREAMING;
2105-
name = "Metadata";
21062102
break;
21072103
}
21082104

2109-
snprintf(vdev->name, sizeof(vdev->name), "%s %u", name,
2110-
stream->header.bTerminalLink);
2105+
strscpy(vdev->name, dev->name, sizeof(vdev->name));
21112106

21122107
/*
21132108
* Set the driver data before calling video_register_device, otherwise

0 commit comments

Comments
 (0)