From nobody Mon Oct 6 20:57:12 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A77628504A; Thu, 17 Jul 2025 17:38:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752773915; cv=none; b=fA2p6j1ttxgoUUSSz6zHnNWqx7cAtAvLYKJTow5m0iX0chh5v2CW/vGgCNIoaSCrC/oOtMyVqn2QC7FyjX9VUdVuIxU66E7mcVNfJa51gKTXnCfyC5IlKOnp+yR7tu3J6GmgS2ATkn43uSunHBbKYE+FqMZZ4Fatk7vkd9g09fs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752773915; c=relaxed/simple; bh=IOGKTg8m2lLVk2BGnUQp473zWXZ7OF1rNECuXqPIWig=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UQjTjGO75VlY9KrSSd6CrJ4UboREV0YODUNPKNN3iACLZfS3CdqRvtCqE9ZDgT8z2oZuSFmWnG47GLHmXJNmebznF9AfLE0YPTDCj4uwfpXwR+WnUNu9SD7Yif9iW9aDGjRgNTuJ3TtHj+8Da3vIMGKGvWwDw118+BfT9B52X2M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=S7k7bG+X; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="S7k7bG+X" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BCA05C4CEED; Thu, 17 Jul 2025 17:38:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1752773915; bh=IOGKTg8m2lLVk2BGnUQp473zWXZ7OF1rNECuXqPIWig=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S7k7bG+XVGbJjyMITPa/JPRu00qfyWjDajxpi0KY3FirkEVkQDkKTl6XCYEW7Bx0B Xp7HP71qQIBqAGwOpf/Gk1UOGDRm60crLysLaeJWwlPyq+Hz+08KfOK3DwTmiXMdRQ cxN9qRRho0KgF89OAcC41dVXA+/IYIGt9lUroKAgI45AhSqX1bTLUSKF6Kvf94V2pl gza6w2L5lQmFo0t4xzdOVwqw4jz/yWUkhQ+S2HfWXMySYxDqyprWHDiyiJ/ICXYRT/ pC7t7mqYBXTx91e7A1tglUnEhu+GbOYNm6iMsYZfPHEQCXgsu4JjfxxDETg57jjZf4 kGB4WL7MRx4Jg== From: Mario Limonciello To: David Airlie , Bjorn Helgaas Cc: Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , Simona Vetter , Lukas Wunner , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Woodhouse , Lu Baolu , Joerg Roedel , Will Deacon , Robin Murphy , Alex Williamson , Jaroslav Kysela , Takashi Iwai , dri-devel@lists.freedesktop.org (open list:DRM DRIVERS), linux-kernel@vger.kernel.org (open list), iommu@lists.linux.dev (open list:INTEL IOMMU (VT-d)), linux-pci@vger.kernel.org (open list:PCI SUBSYSTEM), kvm@vger.kernel.org (open list:VFIO DRIVER), linux-sound@vger.kernel.org (open list:SOUND), Daniel Dadap , Mario Limonciello , Takashi Iwai , Simona Vetter , Bjorn Helgaas Subject: [PATCH v9 5/9] ALSA: hda: Use pci_is_display() Date: Thu, 17 Jul 2025 12:38:08 -0500 Message-ID: <20250717173812.3633478-6-superm1@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250717173812.3633478-1-superm1@kernel.org> References: <20250717173812.3633478-1-superm1@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Mario Limonciello The inline pci_is_display() helper does the same thing. Use it. Reviewed-by: Takashi Iwai Reviewed-by: Daniel Dadap Reviewed-by: Simona Vetter Suggested-by: Bjorn Helgaas Signed-off-by: Mario Limonciello --- sound/hda/hdac_i915.c | 2 +- sound/pci/hda/hda_intel.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/hda/hdac_i915.c b/sound/hda/hdac_i915.c index e9425213320ea..44438c799f957 100644 --- a/sound/hda/hdac_i915.c +++ b/sound/hda/hdac_i915.c @@ -155,7 +155,7 @@ static int i915_gfx_present(struct pci_dev *hdac_pci) =20 for_each_pci_dev(display_dev) { if (display_dev->vendor !=3D PCI_VENDOR_ID_INTEL || - (display_dev->class >> 16) !=3D PCI_BASE_CLASS_DISPLAY) + !pci_is_display(display_dev)) continue; =20 if (pci_match_id(denylist, display_dev)) diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 439cf1bda6e66..75badb5c69b8e 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -1465,7 +1465,7 @@ static struct pci_dev *get_bound_vga(struct pci_dev *= pci) * the dGPU is the one who is involved in * vgaswitcheroo. */ - if (((p->class >> 16) =3D=3D PCI_BASE_CLASS_DISPLAY) && + if (pci_is_display(p) && (atpx_present() || apple_gmux_detect(NULL, NULL))) return p; pci_dev_put(p); @@ -1477,7 +1477,7 @@ static struct pci_dev *get_bound_vga(struct pci_dev *= pci) p =3D pci_get_domain_bus_and_slot(pci_domain_nr(pci->bus), pci->bus->number, 0); if (p) { - if ((p->class >> 16) =3D=3D PCI_BASE_CLASS_DISPLAY) + if (pci_is_display(p)) return p; pci_dev_put(p); } --=20 2.43.0