static inline int cxl_pcie_config_info(struct pci_bus *bus, unsigned int devfn, struct cxl_afu *afu, int *_record) { int record; record = cxl_pcie_cfg_record(bus->number, devfn); if (record > afu->crs_num) return PCIBIOS_DEVICE_NOT_FOUND; *_record = record; return 0; }
static int cxl_pcie_config_info(struct pci_bus *bus, unsigned int devfn, struct cxl_afu **_afu, int *_record) { struct pci_controller *phb; struct cxl_afu *afu; int record; phb = pci_bus_to_host(bus); if (phb == NULL) return PCIBIOS_DEVICE_NOT_FOUND; afu = (struct cxl_afu *)phb->private_data; record = cxl_pcie_cfg_record(bus->number, devfn); if (record > afu->crs_num) return PCIBIOS_DEVICE_NOT_FOUND; *_afu = afu; *_record = record; return 0; }
unsigned int cxl_pci_to_cfg_record(struct pci_dev *dev) { return cxl_pcie_cfg_record(dev->bus->number, dev->devfn); }