Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp866758pxf; Thu, 18 Mar 2021 13:31:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6Al4kP5EOaUJuvLPS8U9dDYsNnXYgJErXIFck3rYmKZSxrDX6LpVm1spR4DdK9hADE+1w X-Received: by 2002:a17:906:a896:: with SMTP id ha22mr375495ejb.503.1616099493279; Thu, 18 Mar 2021 13:31:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616099493; cv=none; d=google.com; s=arc-20160816; b=TuhpPNEycaKIGu+u60EeOXY8uJn+FsO/YFNl91QNNWXdCFdHJWUwo/YNYpYsahtMX3 4oYZiozLvQ1t3vHWMGC2TLuKkqDORmYFGtDMz0Waigo8ETzmA8IoDCE18x4f35D6ouNJ MXZ4gPmcMCBF190S0ePyb49TpPXoRpUZJudOPU4Y/Gu9XoUVOoqCQJIZ06Xh131c5xxq QABnquVfkdTVlb2mc597lsrBu3wFyhmsZrKzpsT7+mnI7kG3453SgpVYZ8ZptZ7KtLKT KX6BIJssVHYta7hvTYp2cWiqR8BItUjpku3fVc4/TjtKuG5ebcAMoqlNTMFkMAwySR+o ZpzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1w+yB/Vqk+uy2WQ0zMmIaM63jYG8/iXQEcm7mXu6CN0=; b=uzDSSzTsnERfEMBC3vnr3i7P3yukaxEcl91C09Ix0uhYm/y33kfyfz/6NPJGDz8quA hdCa+hE43GX5QwKxlT92UI5Z0875LqFEqqsKjZRYj9PoabyjA1m0X72RzRawVW2PKvFy VChAvW3+FPPA9OQkx4sIpZ1vkMLOaXt8GzCjI/mNx3WJ7L576H12VOpnZ2UknGzBTcKO XE8/tQnMpTy580uLsvkFDgsDZ00v3sNwNIMBm72CFwBqHqHWIwhHTdrDnTzbqv2a2FCB bOMU28WXGjeHWWUKsNRcKYZJx5WnYQHeNrsbMHRlAyNWFGU6lVszNt3nBOg44v8sf/Nc 27Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=knCtczGq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sa7si2893973ejb.49.2021.03.18.13.31.10; Thu, 18 Mar 2021 13:31:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=knCtczGq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233212AbhCRUaR (ORCPT + 99 others); Thu, 18 Mar 2021 16:30:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233095AbhCRU3g (ORCPT ); Thu, 18 Mar 2021 16:29:36 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63DC3C061760 for ; Thu, 18 Mar 2021 13:29:36 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id bf3so8306749edb.6 for ; Thu, 18 Mar 2021 13:29:36 -0700 (PDT) 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=1w+yB/Vqk+uy2WQ0zMmIaM63jYG8/iXQEcm7mXu6CN0=; b=knCtczGqIp4yGRnucKtZVemea6vyGs+o/wVyeXHrwGywUzdxQuCZ6hCcCKSiPbmDjh 5GGzbcoMUFAHgiUO068mp04lRW5Fg3vNxSKc4wOKByVooHa/Bsynz9y2opsdT72OPAnQ h+P9yxbv27aT2jxulRUqvFe5eY09Wtk2Tvc5M= 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=1w+yB/Vqk+uy2WQ0zMmIaM63jYG8/iXQEcm7mXu6CN0=; b=BhWAO9+Nv3/C9EyKGbYleZU4xlB8FKVcnCDvB5I42j9chGyK5Exd8T5SamJy+VMFhf utgn9AuXfTg+9+18r2tZNnsZ2QwZ59dhO0j/EG76C0XmZKIHwtZt6dXa+6dAIifM8Ji+ tE2iuYrOeD98jxp1DHOLhbX1H4Sb95C9oko7Ep/nLckkXQmNxzHIdHDJSKPJdf3C6ziY WJrvI0Roq8eXLVV2yGvRaLyg84aXF3UjLWrUijCgGLg8OkksLDoTRQIA/eOiuxFYKcDG 4OlkKDbjBOMsARrXxUtaiMY5hBSmFbINorO0gLa7uTgC/i1ywp3mBnRGg/Jm/7rAXhVv wKfA== X-Gm-Message-State: AOAM531wlhd7JE5oRmgDQQFyiv7t3ZUdmouilnZc8/NeNUA0+j9bXA3e 5YbeEGb1QdGXvJT7OLnlgl0ARw== X-Received: by 2002:a05:6402:512:: with SMTP id m18mr5740025edv.372.1616099375130; Thu, 18 Mar 2021 13:29:35 -0700 (PDT) Received: from alco.lan ([80.71.134.83]) by smtp.gmail.com with ESMTPSA id a22sm2533767ejr.89.2021.03.18.13.29.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Mar 2021 13:29:34 -0700 (PDT) From: Ricardo Ribalda To: Laurent Pinchart , Mauro Carvalho Chehab , Hans Verkuil , Sergey Senozhatsky , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, tfiga@chromium.org Cc: Ricardo Ribalda Subject: [PATCH v7 08/17] media: uvcvideo: Use dev->name for querycap() Date: Thu, 18 Mar 2021 21:29:19 +0100 Message-Id: <20210318202928.166955-9-ribalda@chromium.org> X-Mailer: git-send-email 2.31.0.rc2.261.g7f71774620-goog In-Reply-To: <20210318202928.166955-1-ribalda@chromium.org> References: <20210318202928.166955-1-ribalda@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the device name for the card name instead of vdev->name. Signed-off-by: Hans Verkuil Suggested-by: Laurent Pinchart Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_metadata.c | 2 +- drivers/media/usb/uvc/uvc_v4l2.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_metadata.c b/drivers/media/usb/uvc/uvc_metadata.c index b6279ad7ac84..82de7781f5b6 100644 --- a/drivers/media/usb/uvc/uvc_metadata.c +++ b/drivers/media/usb/uvc/uvc_metadata.c @@ -30,7 +30,7 @@ static int uvc_meta_v4l2_querycap(struct file *file, void *fh, struct uvc_video_chain *chain = stream->chain; strscpy(cap->driver, "uvcvideo", sizeof(cap->driver)); - strscpy(cap->card, vfh->vdev->name, sizeof(cap->card)); + strscpy(cap->card, stream->dev->name, sizeof(cap->card)); usb_make_path(stream->dev->udev, cap->bus_info, sizeof(cap->bus_info)); cap->capabilities = V4L2_CAP_DEVICE_CAPS | V4L2_CAP_STREAMING | chain->caps; diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c index 397217171bbb..dd10cb9361fa 100644 --- a/drivers/media/usb/uvc/uvc_v4l2.c +++ b/drivers/media/usb/uvc/uvc_v4l2.c @@ -617,13 +617,12 @@ static int uvc_v4l2_release(struct file *file) static int uvc_ioctl_querycap(struct file *file, void *fh, struct v4l2_capability *cap) { - struct video_device *vdev = video_devdata(file); struct uvc_fh *handle = file->private_data; struct uvc_video_chain *chain = handle->chain; struct uvc_streaming *stream = handle->stream; strscpy(cap->driver, "uvcvideo", sizeof(cap->driver)); - strscpy(cap->card, vdev->name, sizeof(cap->card)); + strscpy(cap->card, handle->stream->dev->name, sizeof(cap->card)); usb_make_path(stream->dev->udev, cap->bus_info, sizeof(cap->bus_info)); cap->capabilities = V4L2_CAP_DEVICE_CAPS | V4L2_CAP_STREAMING | chain->caps; -- 2.31.0.rc2.261.g7f71774620-goog