Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp639535pxb; Tue, 5 Apr 2022 16:56:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1gMcD2AvbYE/yp7CV4SvQrAa82SRYbeTCWiVRoWQixiAJj+e4M+9X4/X3PCQgLJPhKd7O X-Received: by 2002:a17:902:f64d:b0:14f:fb63:f1a with SMTP id m13-20020a170902f64d00b0014ffb630f1amr5860066plg.159.1649203000410; Tue, 05 Apr 2022 16:56:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649203000; cv=none; d=google.com; s=arc-20160816; b=Cp7An4rd24//M2aAPuHia7BrldkKto71k/uZtqmK8ptSPLiGuRBlKQFZQdr+i3HzW0 xcQJkFgCy9MWELDquW+Vyjj+O+f0yBBfanhaKLNWldJanMzRLNp/AHzhpBhhr+AtJLRE l1x1o3E412zcrkc1Z2fLkbpKqdVbZAH/OD2TEw7aVZQ/4Cy9sEQeqn+Ck9KwjIIyRx4Q p1iNN6n7t1r6woRhQ3KtGxfqAbHMiqynpRvEIQBvg6k0KtCsQUkWxQiwQy7xmQk4LVjt DAaF2V8V8SNZSFy3AqUR7++j4oNpyVXz9RkzG/DtjcvYRtHx0dxTDALNrOdUWWTBnR9b 0kqA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Dh42BGzPUMpFngwiTcTMgRysRvvwllZu0qT8AkdYMZM=; b=zW3Zkd/Qc2flkrDuO1fL88+cRJIQYe6LfkpZCOUYPIIrPSpnY/jFxq05xykHMsluds WDUqiaZ0WMkRkCtcjMZkRwcNFNqbDno8v+jo2fJVewGqXDlfGJVNtuOOghmpOfiSrwQh Vd9O/gXYeNEYirGWz4a0bVaX+486thNX87XRp7e+NOPvx/P5A2g8xSXxKGlozK5qXDfu lEYbmqUN248Qbv4m4TJKfnDWR9Pb+GIEwH/0TXOwwLZdYunxOBRfdLY9HzhXaGPnBkus bVVTLzCb+3WvRhYWwAT60Y969+/61Q3B7MIvLXQQ276e7R94/6e8EY5syeMYDuWwi8JJ KKaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Emu/y7jz"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id qe11-20020a17090b4f8b00b001bfc324fc16si3751477pjb.99.2022.04.05.16.56.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 16:56:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Emu/y7jz"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C3CF0279716; Tue, 5 Apr 2022 16:42:10 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359535AbiDEL5E (ORCPT + 99 others); Tue, 5 Apr 2022 07:57:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244801AbiDEIwk (ORCPT ); Tue, 5 Apr 2022 04:52:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2BD0205F8; Tue, 5 Apr 2022 01:44:10 -0700 (PDT) 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 A917C6117A; Tue, 5 Apr 2022 08:44:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B25CEC385A1; Tue, 5 Apr 2022 08:44:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649148249; bh=ILHz7ulA5x04gj7iYCp96oECxga7eMHwl9e/gQq2a24=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Emu/y7jztKbCbwRn7WRf4rDGxnTJ5EM1hH00PLFHdxXnVdfFfHo4b6U3IOjNun/HM R/so+sba3O46S1+Q4iSV30vlEj+LHc5HHToRP42rRWrTjTOI+KHhWOGkoCUyxK5RCH ueDAq5KUoR1vE3RDcy4nhCuAk0QNSa4FnqOOtHiY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ondrej Zary , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.16 0288/1017] media: bttv: fix WARNING regression on tunerless devices Date: Tue, 5 Apr 2022 09:20:01 +0200 Message-Id: <20220405070402.820680932@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ondrej Zary [ Upstream commit ef058cc8b7193d15a771272359c7454839ae74ee ] Commit 2161536516ed ("media: media/pci: set device_caps in struct video_device") introduced a regression: V4L2_CAP_TUNER is always present in device_caps, even when the device has no tuner. This causes a warning: WARNING: CPU: 0 PID: 249 at drivers/media/v4l2-core/v4l2-ioctl.c:1102 v4l_querycap+0xa0/0xb0 [videodev] Fixes: 2161536516ed ("media: media/pci: set device_caps in struct video_device") Signed-off-by: Ondrej Zary Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/pci/bt8xx/bttv-driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c index 0e9df8b35ac6..661ebfa7bf3f 100644 --- a/drivers/media/pci/bt8xx/bttv-driver.c +++ b/drivers/media/pci/bt8xx/bttv-driver.c @@ -3890,7 +3890,7 @@ static int bttv_register_video(struct bttv *btv) /* video */ vdev_init(btv, &btv->video_dev, &bttv_video_template, "video"); - btv->video_dev.device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_TUNER | + btv->video_dev.device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE | V4L2_CAP_STREAMING; if (btv->tuner_type != TUNER_ABSENT) btv->video_dev.device_caps |= V4L2_CAP_TUNER; @@ -3911,7 +3911,7 @@ static int bttv_register_video(struct bttv *btv) /* vbi */ vdev_init(btv, &btv->vbi_dev, &bttv_video_template, "vbi"); btv->vbi_dev.device_caps = V4L2_CAP_VBI_CAPTURE | V4L2_CAP_READWRITE | - V4L2_CAP_STREAMING | V4L2_CAP_TUNER; + V4L2_CAP_STREAMING; if (btv->tuner_type != TUNER_ABSENT) btv->vbi_dev.device_caps |= V4L2_CAP_TUNER; -- 2.34.1