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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4D9C1C4332F for ; Tue, 14 Nov 2023 10:14:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1F24F10E1EF; Tue, 14 Nov 2023 10:14:02 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7862110E1F2 for ; Tue, 14 Nov 2023 10:14:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699956840; x=1731492840; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vxaiLcGzfNk0ddfcrq6pq99BkBv8gE1W9AOZ6yAzypg=; b=TxTSKYPBQo0AIJ1FHiQXlix7v/sH0Zwgh6GLahDQq6LGNZj+fzozSap2 sZ8hJj490eJpJ+OsGklxJ86R2ueMAce7RrdJV9LiO3/m8nZQrSAlVfCmF mx6Xd6zXgdb5P9cuUWUSnX8V7Q6cehUejeE0TLXjWJ2FYeYQXQ7mmnUxr YSClDoAqTXUgTepo7mU3r9xT/IB2de1X4EEjDJslPq4fGYYoGS1FKtVzW duA9YGHaoUXaoTUxYvZuQYFZggcI4lH3L+iQwgHWq/YKOFjYPg/zvHasK dIqgifI7G8MQiH9AQk656vJs/KWtq5+YF9OAhAODwUJUhzbpIACEo2vGP w==; X-IronPort-AV: E=McAfee;i="6600,9927,10893"; a="375669089" X-IronPort-AV: E=Sophos;i="6.03,301,1694761200"; d="scan'208";a="375669089" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Nov 2023 02:14:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.03,301,1694761200"; d="scan'208";a="5974150" Received: from sannilnx-dsk.jer.intel.com ([10.12.231.107]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Nov 2023 02:13:58 -0800 From: Alexander Usyskin To: Greg Kroah-Hartman , Lucas De Marchi , Daniele Ceraolo Spurio , Rodrigo Vivi Date: Tue, 14 Nov 2023 12:08:40 +0200 Message-Id: <20231114100843.1923977-3-alexander.usyskin@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231114100843.1923977-1-alexander.usyskin@intel.com> References: <20231114100843.1923977-1-alexander.usyskin@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Intel-xe] [PATCH v2 2/5] mei: hdcp: match without driver name X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, Tomas Winkler , Alexander Usyskin , intel-xe@lists.freedesktop.org Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" Remove dependency on i915 driver name in component_match function. Use PCI header information to match Intel graphics device. Signed-off-by: Alexander Usyskin --- drivers/misc/mei/hdcp/mei_hdcp.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/misc/mei/hdcp/mei_hdcp.c b/drivers/misc/mei/hdcp/mei_hdcp.c index 51359cc5ece9..f8759a6c9ed3 100644 --- a/drivers/misc/mei/hdcp/mei_hdcp.c +++ b/drivers/misc/mei/hdcp/mei_hdcp.c @@ -17,6 +17,7 @@ */ #include +#include #include #include #include @@ -781,9 +782,18 @@ static int mei_hdcp_component_match(struct device *dev, int subcomponent, void *data) { struct device *base = data; + struct pci_dev *pdev; - if (!dev->driver || strcmp(dev->driver->name, "i915") || - subcomponent != I915_COMPONENT_HDCP) + if (!dev_is_pci(dev)) + return 0; + + pdev = to_pci_dev(dev); + + if (pdev->class != (PCI_CLASS_DISPLAY_VGA << 8) || + pdev->vendor != PCI_VENDOR_ID_INTEL) + return 0; + + if (subcomponent != I915_COMPONENT_HDCP) return 0; base = base->parent; -- 2.34.1