[PATCH 2/2] mei/mei_pxp: Use check for intel gfx instead of i915 in match functions

Ankit Nautiyal ankit.k.nautiyal at intel.com
Wed Aug 9 16:04:05 UTC 2023


Instead of explicitly checking for i915 driver check for the
device being an intel graphics card. This will help to have compibility
with xe driver.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal at intel.com>
---
 drivers/misc/mei/pxp/mei_pxp.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/mei/pxp/mei_pxp.c b/drivers/misc/mei/pxp/mei_pxp.c
index 3bf560bbdee0..6a1cf57a22de 100644
--- a/drivers/misc/mei/pxp/mei_pxp.c
+++ b/drivers/misc/mei/pxp/mei_pxp.c
@@ -15,6 +15,7 @@
 #include <linux/slab.h>
 #include <linux/mei.h>
 #include <linux/mei_cl_bus.h>
+#include <linux/pci.h>
 #include <linux/component.h>
 #include <drm/drm_connector.h>
 #include <drm/i915_component.h>
@@ -155,11 +156,17 @@ static int mei_pxp_component_match(struct device *dev, int subcomponent,
 				   void *data)
 {
 	struct device *base = data;
+	struct pci_dev *pdev;
+
+	if (!dev_is_pci(dev))
+		return 0;
+
+	pdev = to_pci_dev(dev);
 
 	if (!dev)
 		return 0;
 
-	if (!dev->driver || strcmp(dev->driver->name, "i915") ||
+	if (!dev->driver || pdev->vendor != PCI_VENDOR_ID_INTEL ||
 	    subcomponent != I915_COMPONENT_PXP)
 		return 0;
 
-- 
2.40.1



More information about the Intel-gfx-trybot mailing list