From nobody Thu Oct 9 14:42:17 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 8F26127991E; Tue, 17 Jun 2025 17:59:30 +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=1750183170; cv=none; b=Uki/VVeKkrtg28+aXtx4+kVtJ03WbpfTxxRhnyPCrwHUVe/6l4n8GC7/gmlBIUqJzCrcoS1zhTjbTfngqkwB9fkslidfv0kzgZXY1mvdxXkrprcSueLP35RUbCZvssu04k/5rOivglwz0RySPm9HrITHbTUjsVcpRXEe9ZapN8Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750183170; c=relaxed/simple; bh=7UZGrblneAtFey369IMyzZF/udvRe/m3MafrVy9aQVg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rrmeJXejLGMrL1cM8KA0nY+iuySwHb0UCgR5ndSZEcIY3iKC/+migCGfL7plri3leq+h0CMIr7bSsgSTQcPVU6L6xs5Fi4OEOcQp1jGxiG4zn58hr3t46NgbwYEppr3X1keNsI8ezolPBtq0rUmj1SD0WwLIr8XLgn/sM015DMY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DJyEf2oc; 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="DJyEf2oc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33C51C4CEE7; Tue, 17 Jun 2025 17:59:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1750183170; bh=7UZGrblneAtFey369IMyzZF/udvRe/m3MafrVy9aQVg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DJyEf2oc+Mu+ag8PcFekljMuzR1hwylZlTEtwPiy6tb3X4dNQgDD9Jf5EnwaLG8i5 9LwFWjBxWLi9ifSe9I+8Iz3wX7ICzMDfh2/hg1VrCzeH3XDlwkbtdMkOZkZ+yY9n5I 3Lq1mogn3jjDGe9Rd1I3oTDJkCehnVRyITTXDVLunW8gRCautJP1gOWjiB6BP8ZU+S y1iexDbE+ZSmmFjlZ4lS3aZPC90kxI2FpibS54PUi2/PnIGNqbxS4mJOxtCRsS4K9j WBb02/8p3FuGu05xLzsT4oZR1tTx+P0RcxnzGaC+F2CYDeFNQYyI4dNBD3eNjkwLR7 4q22JkK9np3CA== From: Mario Limonciello To: Bjorn Helgaas Cc: Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , David Airlie , 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 , Bjorn Helgaas Subject: [PATCH v2 5/6] ALSA: hda: Use pci_is_display() Date: Tue, 17 Jun 2025 12:59:09 -0500 Message-ID: <20250617175910.1640546-6-superm1@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250617175910.1640546-1-superm1@kernel.org> References: <20250617175910.1640546-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. Suggested-by: Bjorn Helgaas Signed-off-by: Mario Limonciello Reviewed-by: Simona Vetter --- 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 e5210ed48ddf1..a165c44b43940 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