]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: hda: Use pci_is_display()
authorMario Limonciello <mario.limonciello@amd.com>
Thu, 17 Jul 2025 17:38:08 +0000 (12:38 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 17 Jul 2025 20:30:13 +0000 (15:30 -0500)
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
sound/hda/hdac_i915.c
sound/pci/hda/hda_intel.c

index e9425213320eae71dbb5297c03195193fb437665..44438c799f9570f1d97c2761884cac72c88f6fe9 100644 (file)
@@ -155,7 +155,7 @@ static int i915_gfx_present(struct pci_dev *hdac_pci)
 
        for_each_pci_dev(display_dev) {
                if (display_dev->vendor != PCI_VENDOR_ID_INTEL ||
-                   (display_dev->class >> 16) != PCI_BASE_CLASS_DISPLAY)
+                   !pci_is_display(display_dev))
                        continue;
 
                if (pci_match_id(denylist, display_dev))
index e5210ed48ddf1698769d2e3f112c202bc8367492..a165c44b439405d59d6a12029232cfe65a19646a 100644 (file)
@@ -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) == 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 = pci_get_domain_bus_and_slot(pci_domain_nr(pci->bus),
                                                        pci->bus->number, 0);
                        if (p) {
-                               if ((p->class >> 16) == PCI_BASE_CLASS_DISPLAY)
+                               if (pci_is_display(p))
                                        return p;
                                pci_dev_put(p);
                        }