Commit 7b77061f authored by Wei Yang's avatar Wei Yang Committed by Michael Ellerman

PCI: Add pcibios_bus_add_device() weak function

This adds weak function pcibios_bus_add_device() for arch dependent
code could do proper setup. For example, powerpc could setup EEH
related resources for SRIOV VFs.
Signed-off-by: default avatarWei Yang <weiyang@linux.vnet.ibm.com>
Reviewed-by: default avatarGavin Shan <gwshan@linux.vnet.ibm.com>
Acked-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent c194f7ea
...@@ -271,6 +271,8 @@ bool pci_bus_clip_resource(struct pci_dev *dev, int idx) ...@@ -271,6 +271,8 @@ bool pci_bus_clip_resource(struct pci_dev *dev, int idx)
void __weak pcibios_resource_survey_bus(struct pci_bus *bus) { } void __weak pcibios_resource_survey_bus(struct pci_bus *bus) { }
void __weak pcibios_bus_add_device(struct pci_dev *pdev) { }
/** /**
* pci_bus_add_device - start driver for a single device * pci_bus_add_device - start driver for a single device
* @dev: device to add * @dev: device to add
...@@ -285,6 +287,7 @@ void pci_bus_add_device(struct pci_dev *dev) ...@@ -285,6 +287,7 @@ void pci_bus_add_device(struct pci_dev *dev)
* Can not put in pci_device_add yet because resources * Can not put in pci_device_add yet because resources
* are not assigned yet for some devices. * are not assigned yet for some devices.
*/ */
pcibios_bus_add_device(dev);
pci_fixup_device(pci_fixup_final, dev); pci_fixup_device(pci_fixup_final, dev);
pci_create_sysfs_dev_files(dev); pci_create_sysfs_dev_files(dev);
pci_proc_attach_device(dev); pci_proc_attach_device(dev);
......
...@@ -770,6 +770,7 @@ extern struct list_head pci_root_buses; /* list of all known PCI buses */ ...@@ -770,6 +770,7 @@ extern struct list_head pci_root_buses; /* list of all known PCI buses */
int no_pci_devices(void); int no_pci_devices(void);
void pcibios_resource_survey_bus(struct pci_bus *bus); void pcibios_resource_survey_bus(struct pci_bus *bus);
void pcibios_bus_add_device(struct pci_dev *pdev);
void pcibios_add_bus(struct pci_bus *bus); void pcibios_add_bus(struct pci_bus *bus);
void pcibios_remove_bus(struct pci_bus *bus); void pcibios_remove_bus(struct pci_bus *bus);
void pcibios_fixup_bus(struct pci_bus *); void pcibios_fixup_bus(struct pci_bus *);
......
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