On Wed, 18 Dec 2024, Dnyaneshwar Bhadane <[email protected]> wrote: > +/* > + * Some ARLs SoCs have the same drm PCI IDs, so need a helper to > differentiate based > + * on the host bridge device ID to get the correct txx_mics value. > + */ > +static bool is_arrowlake_s_by_host_bridge(void) > +{ > + struct pci_dev *pdev = NULL; > + u16 host_bridge_pci_dev_id; > + > + while ((pdev = pci_get_class(PCI_CLASS_BRIDGE_HOST << 8, pdev))) > + host_bridge_pci_dev_id = pdev->device; > + > + return pdev && IS_ARROWLAKE_S_BY_HOST_BRIDGE_ID(host_bridge_pci_dev_id); > +}
I was just reading the code, and stumbled on this two years after it was merged. The function *always* returns false, because pdev is always NULL when the while loop terminates. BR, Jani. -- Jani Nikula, Intel
