Commit ceeedd95 authored by Alexander Usyskin's avatar Alexander Usyskin Committed by Greg Kroah-Hartman

mei: pxp: match without driver name

Xe driver uses this component too, but current match function
matches by i915 driver name.
Remove dependency on i915 driver name in component_match function.
Use PCI header information to match Intel graphics device.
Signed-off-by: default avatarAlexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Link: https://lore.kernel.org/r/20240123101625.220365-3-tomas.winkler@intel.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6244a8b6
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/pci.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/mei.h> #include <linux/mei.h>
#include <linux/mei_cl_bus.h> #include <linux/mei_cl_bus.h>
...@@ -225,12 +226,21 @@ static int mei_pxp_component_match(struct device *dev, int subcomponent, ...@@ -225,12 +226,21 @@ static int mei_pxp_component_match(struct device *dev, int subcomponent,
void *data) void *data)
{ {
struct device *base = data; struct device *base = data;
struct pci_dev *pdev;
if (!dev) if (!dev)
return 0; return 0;
if (!dev->driver || strcmp(dev->driver->name, "i915") || if (!dev_is_pci(dev))
subcomponent != I915_COMPONENT_PXP) return 0;
pdev = to_pci_dev(dev);
if (pdev->class != (PCI_CLASS_DISPLAY_VGA << 8) ||
pdev->vendor != PCI_VENDOR_ID_INTEL)
return 0;
if (subcomponent != I915_COMPONENT_PXP)
return 0; return 0;
base = base->parent; base = base->parent;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment