mirror of https://gitee.com/openkylin/linux.git
PCI: Add pcibios_add_device
Platforms may want to provide architecture-specific functionality during PCI enumeration. Add a pcibios_add_device() call that architectures can override to do so. Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Tested-by: Seth Forshee <seth.forshee@canonical.com>
This commit is contained in:
parent
dd5fc854de
commit
eca0d4676d
|
@ -170,6 +170,11 @@ int pci_bus_add_device(struct pci_dev *dev)
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
pci_fixup_device(pci_fixup_final, dev);
|
pci_fixup_device(pci_fixup_final, dev);
|
||||||
|
|
||||||
|
retval = pcibios_add_device(dev);
|
||||||
|
if (retval)
|
||||||
|
return retval;
|
||||||
|
|
||||||
retval = device_add(&dev->dev);
|
retval = device_add(&dev->dev);
|
||||||
if (retval)
|
if (retval)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
|
@ -1333,6 +1333,19 @@ void pcim_pin_device(struct pci_dev *pdev)
|
||||||
dr->pinned = 1;
|
dr->pinned = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* pcibios_add_device - provide arch specific hooks when adding device dev
|
||||||
|
* @dev: the PCI device being added
|
||||||
|
*
|
||||||
|
* Permits the platform to provide architecture specific functionality when
|
||||||
|
* devices are added. This is the default implementation. Architecture
|
||||||
|
* implementations can override this.
|
||||||
|
*/
|
||||||
|
int __weak pcibios_add_device (struct pci_dev *dev)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pcibios_disable_device - disable arch specific PCI resources for device dev
|
* pcibios_disable_device - disable arch specific PCI resources for device dev
|
||||||
* @dev: the PCI device to disable
|
* @dev: the PCI device to disable
|
||||||
|
|
|
@ -1592,6 +1592,7 @@ void pcibios_disable_device(struct pci_dev *dev);
|
||||||
void pcibios_set_master(struct pci_dev *dev);
|
void pcibios_set_master(struct pci_dev *dev);
|
||||||
int pcibios_set_pcie_reset_state(struct pci_dev *dev,
|
int pcibios_set_pcie_reset_state(struct pci_dev *dev,
|
||||||
enum pcie_reset_state state);
|
enum pcie_reset_state state);
|
||||||
|
int pcibios_add_device(struct pci_dev *dev);
|
||||||
|
|
||||||
#ifdef CONFIG_PCI_MMCONFIG
|
#ifdef CONFIG_PCI_MMCONFIG
|
||||||
extern void __init pci_mmcfg_early_init(void);
|
extern void __init pci_mmcfg_early_init(void);
|
||||||
|
|
Loading…
Reference in New Issue