> >+static int mei_lb_component_match(struct device *dev, int subcomponent,
> >+                              void *data)
> >+{
> >+    /*
> >+     * This function checks if requester is Intel %PCI_CLASS_DISPLAY_VGA
> or
> >+     * %PCI_CLASS_DISPLAY_OTHER device, and checks if the requester is
> the
> >+     * grand parent of mei_if i.e. late bind MEI device
> >+     */
> >+    struct device *base = data;
> >+    struct pci_dev *pdev;
> >+
> >+    if (!dev)
> >+            return 0;
> >+
> >+    if (!dev_is_pci(dev))
> >+            return 0;
> >+
> >+    pdev = to_pci_dev(dev);
> >+
> >+    if (pdev->vendor != PCI_VENDOR_ID_INTEL)
> >+            return 0;
> >+
> >+    if (pdev->class != (PCI_CLASS_DISPLAY_VGA << 8) &&
> >+        pdev->class != (PCI_CLASS_DISPLAY_OTHER << 8))
> 
> this doesn't seem right, we should allow other PCI classes. AFAICS this
> check could just be removed and just leave the INTEL_COMPONENT_LB below
> to protect for component match
> 
> Lucas De Marchi
> 

The subcomponent is unique only in its own instance of the component framework.
Or I'm wrong here?
We have to ensure that we have Intel display device, not any other device to
subcomponent check to work correctly.

- - 
Thanks,
Sasha


> >+            return 0;
> >+
> >+    if (subcomponent != INTEL_COMPONENT_LB)
> >+            return 0;
> >+
> >+    base = base->parent;
> >+    if (!base) /* mei device */
> >+            return 0;
> >+
> >+    base = base->parent; /* pci device */
> >+
> >+    return !!base && dev == base;
> >+}
> >+

Reply via email to