Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13A9DC4332F for ; Fri, 14 Jan 2022 08:26:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234466AbiANI0Z (ORCPT ); Fri, 14 Jan 2022 03:26:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240802AbiANIYl (ORCPT ); Fri, 14 Jan 2022 03:24:41 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFE0EC061751; Fri, 14 Jan 2022 00:22:57 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5D05C61E64; Fri, 14 Jan 2022 08:22:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A766C36AE9; Fri, 14 Jan 2022 08:22:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1642148576; bh=a97yzrHeaYRB2rNIwWbcsigwKog41mk+bvC7o3RBMF4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u2pggxnx++UeWeSgOuHDrxotVSzsA1W0qmDALSiM+B8markbR7RM8vWvf8n9vujBr rBoBSFju+eLjXhSAev5v7YEJw8G/9WT63rZBfFXcw6TT3CBmcrqmZpXRHR08fWhuDP L7feDyQHdlA8N9MrY0ZrbNQ5Mb3KC5+kGSR+BHvU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicolas Dufresne , Ricardo Ribalda , Laurent Pinchart , Hans Verkuil , Mauro Carvalho Chehab Subject: [PATCH 5.16 34/37] media: Revert "media: uvcvideo: Set unique vdev name based in type" Date: Fri, 14 Jan 2022 09:16:48 +0100 Message-Id: <20220114081545.965296560@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220114081544.849748488@linuxfoundation.org> References: <20220114081544.849748488@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ricardo Ribalda commit f66dcb32af19faf49cc4a9222c3152b10c6ec84a 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 e3f60e7e1a2b451f538f9926763432249bcf39c4. Link: https://lore.kernel.org/linux-media/20211207003840.1212374-2-ribalda@chromium.org Cc: Fixes: e3f60e7e1a2b ("media: uvcvideo: Set unique vdev name based in type") Reported-by: Nicolas Dufresne Signed-off-by: Ricardo Ribalda Reviewed-by: Laurent Pinchart Reviewed-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/usb/uvc/uvc_driver.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -2193,7 +2193,6 @@ int uvc_register_video_device(struct uvc const struct v4l2_file_operations *fops, const struct v4l2_ioctl_ops *ioctl_ops) { - const char *name; int ret; /* Initialize the video buffers queue. */ @@ -2222,20 +2221,16 @@ int uvc_register_video_device(struct uvc case V4L2_BUF_TYPE_VIDEO_CAPTURE: default: vdev->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING; - name = "Video Capture"; break; case V4L2_BUF_TYPE_VIDEO_OUTPUT: vdev->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING; - name = "Video Output"; break; case V4L2_BUF_TYPE_META_CAPTURE: vdev->device_caps = V4L2_CAP_META_CAPTURE | V4L2_CAP_STREAMING; - name = "Metadata"; break; } - snprintf(vdev->name, sizeof(vdev->name), "%s %u", name, - stream->header.bTerminalLink); + strscpy(vdev->name, dev->name, sizeof(vdev->name)); /* * Set the driver data before calling video_register_device, otherwise