Skip to content

Commit f66dcb3

Browse files
ribaldamchehab
authored andcommitted
media: Revert "media: uvcvideo: Set unique vdev name based in type"
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>
1 parent f421706 commit f66dcb3

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
@@ -2195,7 +2195,6 @@ int uvc_register_video_device(struct uvc_device *dev,
21952195
const struct v4l2_file_operations *fops,
21962196
const struct v4l2_ioctl_ops *ioctl_ops)
21972197
{
2198-
const char *name;
21992198
int ret;
22002199

22012200
/* Initialize the video buffers queue. */
@@ -2224,20 +2223,16 @@ int uvc_register_video_device(struct uvc_device *dev,
22242223
case V4L2_BUF_TYPE_VIDEO_CAPTURE:
22252224
default:
22262225
vdev->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
2227-
name = "Video Capture";
22282226
break;
22292227
case V4L2_BUF_TYPE_VIDEO_OUTPUT:
22302228
vdev->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
2231-
name = "Video Output";
22322229
break;
22332230
case V4L2_BUF_TYPE_META_CAPTURE:
22342231
vdev->device_caps = V4L2_CAP_META_CAPTURE | V4L2_CAP_STREAMING;
2235-
name = "Metadata";
22362232
break;
22372233
}
22382234

2239-
snprintf(vdev->name, sizeof(vdev->name), "%s %u", name,
2240-
stream->header.bTerminalLink);
2235+
strscpy(vdev->name, dev->name, sizeof(vdev->name));
22412236

22422237
/*
22432238
* Set the driver data before calling video_register_device, otherwise

0 commit comments

Comments
 (0)