[PATCH] Revert "ALSA: hda/i915 - skip acomp init if no matching display"

Lucas De Marchi lucas.demarchi at intel.com
Sat Apr 16 05:53:28 UTC 2022


This reverts commit 0dc2696a4623d55f40e925e9185a0fcd4d34e568.
---
 sound/hda/hdac_i915.c | 29 ++++++++++-------------------
 1 file changed, 10 insertions(+), 19 deletions(-)

diff --git a/sound/hda/hdac_i915.c b/sound/hda/hdac_i915.c
index 1ce2cea137db..c42790863805 100644
--- a/sound/hda/hdac_i915.c
+++ b/sound/hda/hdac_i915.c
@@ -116,25 +116,16 @@ static int i915_component_master_match(struct device *dev, int subcomponent,
 	return 0;
 }
 
-/* check whether Intel graphics is present and reachable */
-static int i915_gfx_present(struct pci_dev *hdac_pci)
+/* check whether intel graphics is present */
+static bool i915_gfx_present(void)
 {
-	unsigned int class = PCI_BASE_CLASS_DISPLAY << 16;
-	struct pci_dev *display_dev = NULL;
-	bool match = false;
-
-	do {
-		display_dev = pci_get_class(class, display_dev);
-
-		if (display_dev && display_dev->vendor == PCI_VENDOR_ID_INTEL &&
-		    connectivity_check(display_dev, hdac_pci))
-			match = true;
-
-		pci_dev_put(display_dev);
-
-	} while (!match && display_dev);
-
-	return match;
+	static const struct pci_device_id ids[] = {
+		{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_ANY_ID),
+		  .class = PCI_BASE_CLASS_DISPLAY << 16,
+		  .class_mask = 0xff << 16 },
+		{}
+	};
+	return pci_dev_present(ids);
 }
 
 static bool dg1_gfx_present(void)
@@ -174,7 +165,7 @@ int snd_hdac_i915_init(struct hdac_bus *bus)
 	struct drm_audio_component *acomp;
 	int err;
 
-	if (!i915_gfx_present(to_pci_dev(bus->dev)))
+	if (!i915_gfx_present())
 		return -ENODEV;
 
 	if (dg1_gfx_present())
-- 
2.35.2



More information about the Intel-gfx-trybot mailing list