init.c 670 B

12345678910111213141516171819202122232425262728
  1. #include <linux/pci.h>
  2. #include <linux/init.h>
  3. #include "pci.h"
  4. /* arch_initcall has too random ordering, so call the initializers
  5. in the right sequence from here. */
  6. static __init int pci_access_init(void)
  7. {
  8. #ifdef CONFIG_PCI_MMCONFIG
  9. pci_mmcfg_init();
  10. #endif
  11. if (raw_pci_ops)
  12. return 0;
  13. #ifdef CONFIG_PCI_BIOS
  14. pci_pcbios_init();
  15. #endif
  16. /*
  17. * don't check for raw_pci_ops here because we want pcbios as last
  18. * fallback, yet it's needed to run first to set pcibios_last_bus
  19. * in case legacy PCI probing is used. otherwise detecting peer busses
  20. * fails.
  21. */
  22. #ifdef CONFIG_PCI_DIRECT
  23. pci_direct_init();
  24. #endif
  25. return 0;
  26. }
  27. arch_initcall(pci_access_init);