From patchwork Thu Mar 11 22:19:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 399138 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5832BC43381 for ; Thu, 11 Mar 2021 22:21:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E36164F93 for ; Thu, 11 Mar 2021 22:21:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230510AbhCKWUb (ORCPT ); Thu, 11 Mar 2021 17:20:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230118AbhCKWT7 (ORCPT ); Thu, 11 Mar 2021 17:19:59 -0500 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92CB9C061763 for ; Thu, 11 Mar 2021 14:19:58 -0800 (PST) Received: by mail-ej1-x62d.google.com with SMTP id e19so49548161ejt.3 for ; Thu, 11 Mar 2021 14:19:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NbPbhT2DvRa0HxCcGP6PoWLah825bR8ZY4RDvgqg8WA=; b=lJicX7FJ5deqI7OwxIw6ZUlwlyGn5VV8CT6UaWcZwBl33WV1vrOfptR4vh95JdLrsE GLZW800IXBu8UpyX5AyG8y6tKd3OZz0fCwsZi+QIOJsLnN93K6hHPSisF3+WwDv60Qk8 YgE3w0emYzudMUqDIn+LluAyEMQGrM5AjE6sU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NbPbhT2DvRa0HxCcGP6PoWLah825bR8ZY4RDvgqg8WA=; b=PzHpu1/bUyXiNxj6FCgC/MHxL+Vbc8/K2V8gbTzxbp8iyiPJY6sUyl0sHVtlAIzoZl wRlxKU9Qg5QiVRKB5vj7QPlS/FDKQ2fBKjFavGOBkY/Z0M8hzX3KMgTKh3RIT9qF/ySk FJxWf6j9HYQxamD3FxyxwS8eVEROGuL1+YVYuEARNH8egOK+CYImtZb/7OZa1RuN9+mU l5KQFrWRiqV2bOd37FS4rpDBfe0ps9oBvBZ2TRJr0padfwBJxFCHLN67mBuPwYPxmULF waFIinSnzdJmp5J5OZSAbKpLBVuNaw6Dplm/mm6477wMVqEPKaHyKadxLwTOgFS0ndJQ HIfQ== X-Gm-Message-State: AOAM533irGMpK+Hmqd0b08Y+0heFFzGxy8zn14mbEnPjNoyLIiJkRDM9 jibWZyJB1rWfcXFpJwHNCBgo6Q== X-Google-Smtp-Source: ABdhPJz5b66NydyOmLZdqz5yFVMU3yKizx+Q6wzTzO5kpoK22o9BnowMprQf8ne1d2TEexE8uudKGg== X-Received: by 2002:a17:906:18aa:: with SMTP id c10mr5261577ejf.248.1615501197417; Thu, 11 Mar 2021 14:19:57 -0800 (PST) Received: from alco.lan ([80.71.134.83]) by smtp.gmail.com with ESMTPSA id b18sm1942174ejb.77.2021.03.11.14.19.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 14:19:57 -0800 (PST) From: Ricardo Ribalda To: Laurent Pinchart , Mauro Carvalho Chehab , Tomasz Figa , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, senozhatsky@chromium.org, Hans Verkuil Cc: Ricardo Ribalda Subject: [PATCH v2 6/6] media: uvcvideo: Set a different name for the metadata entity Date: Thu, 11 Mar 2021 23:19:46 +0100 Message-Id: <20210311221946.1319924-7-ribalda@chromium.org> X-Mailer: git-send-email 2.31.0.rc2.261.g7f71774620-goog In-Reply-To: <20210311221946.1319924-1-ribalda@chromium.org> References: <20210311221946.1319924-1-ribalda@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org All the entities must have a unique name. Fixes v4l2-compliance: Media Controller ioctls: fail: v4l2-test-media.cpp(205): v2_entity_names_set.find(key) != v2_entity_names_set.end() test MEDIA_IOC_G_TOPOLOGY: FAIL fail: v4l2-test-media.cpp(394): num_data_links != num_links test MEDIA_IOC_ENUM_ENTITIES/LINKS: FAIL Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_driver.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index 30ef2a3110f7..47efa9a9be99 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -2199,7 +2199,10 @@ int uvc_register_video_device(struct uvc_device *dev, break; } - strscpy(vdev->name, dev->name, sizeof(vdev->name)); + if (type == V4L2_BUF_TYPE_META_CAPTURE) + strscpy(vdev->name, "Metadata Videodev", sizeof(vdev->name)); + else + strscpy(vdev->name, dev->name, sizeof(vdev->name)); /* * Set the driver data before calling video_register_device, otherwise