Skip to content

Commit 6642adf

Browse files
superm1bjorn-helgaas
authored andcommitted
ALSA: hda: Use pci_is_display()
The inline pci_is_display() helper does the same thing. Use it. Suggested-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Reviewed-by: Daniel Dadap <ddadap@nvidia.com> Reviewed-by: Simona Vetter <simona.vetter@ffwll.ch> Link: https://patch.msgid.link/20250717173812.3633478-6-superm1@kernel.org
1 parent 75952c4 commit 6642adf

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

sound/hda/hdac_i915.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ static int i915_gfx_present(struct pci_dev *hdac_pci)
155155

156156
for_each_pci_dev(display_dev) {
157157
if (display_dev->vendor != PCI_VENDOR_ID_INTEL ||
158-
(display_dev->class >> 16) != PCI_BASE_CLASS_DISPLAY)
158+
!pci_is_display(display_dev))
159159
continue;
160160

161161
if (pci_match_id(denylist, display_dev))

sound/pci/hda/hda_intel.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,7 +1465,7 @@ static struct pci_dev *get_bound_vga(struct pci_dev *pci)
14651465
* the dGPU is the one who is involved in
14661466
* vgaswitcheroo.
14671467
*/
1468-
if (((p->class >> 16) == PCI_BASE_CLASS_DISPLAY) &&
1468+
if (pci_is_display(p) &&
14691469
(atpx_present() || apple_gmux_detect(NULL, NULL)))
14701470
return p;
14711471
pci_dev_put(p);
@@ -1477,7 +1477,7 @@ static struct pci_dev *get_bound_vga(struct pci_dev *pci)
14771477
p = pci_get_domain_bus_and_slot(pci_domain_nr(pci->bus),
14781478
pci->bus->number, 0);
14791479
if (p) {
1480-
if ((p->class >> 16) == PCI_BASE_CLASS_DISPLAY)
1480+
if (pci_is_display(p))
14811481
return p;
14821482
pci_dev_put(p);
14831483
}

0 commit comments

Comments
 (0)