diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2013-04-17 12:31:34 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2013-04-17 12:31:34 -0400 |
commit | 723ec4d06cb2eed481436cfe008f5f63c45e88fd (patch) | |
tree | e59112af8616e8fbc0cc6c2219b49fd2f05bfc41 /include/linux/pci.h | |
parent | a3b6bbd5774c13dab89d72f79976ba762913b2f2 (diff) | |
parent | f39d5b72913e2a9ff00ba5ab145ee05a888b1286 (diff) |
Merge branch 'pci/cleanup' into next
* pci/cleanup:
PCI: Remove "extern" from function declarations
PCI: Warn about failures instead of "must_check" functions
PCI: Remove __must_check from definitions
PCI: Remove unused variables
PCI: Move cpci_hotplug_init() proto to header file
PCI: Make local functions/structs static
PCI: Fix missing prototype for pcie_port_acpi_setup()
Conflicts:
drivers/pci/hotplug/acpiphp.h
include/linux/pci.h
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r-- | include/linux/pci.h | 95 |
1 files changed, 47 insertions, 48 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index 4a6ee631a0c5..8aaca26a2b32 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -363,7 +363,7 @@ static inline struct pci_dev *pci_physfn(struct pci_dev *dev) | |||
363 | return dev; | 363 | return dev; |
364 | } | 364 | } |
365 | 365 | ||
366 | extern struct pci_dev *alloc_pci_dev(void); | 366 | struct pci_dev *alloc_pci_dev(void); |
367 | 367 | ||
368 | #define to_pci_dev(n) container_of(n, struct pci_dev, dev) | 368 | #define to_pci_dev(n) container_of(n, struct pci_dev, dev) |
369 | #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) | 369 | #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) |
@@ -519,10 +519,10 @@ struct pci_ops { | |||
519 | * ACPI needs to be able to access PCI config space before we've done a | 519 | * ACPI needs to be able to access PCI config space before we've done a |
520 | * PCI bus scan and created pci_bus structures. | 520 | * PCI bus scan and created pci_bus structures. |
521 | */ | 521 | */ |
522 | extern int raw_pci_read(unsigned int domain, unsigned int bus, | 522 | int raw_pci_read(unsigned int domain, unsigned int bus, unsigned int devfn, |
523 | unsigned int devfn, int reg, int len, u32 *val); | 523 | int reg, int len, u32 *val); |
524 | extern int raw_pci_write(unsigned int domain, unsigned int bus, | 524 | int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn, |
525 | unsigned int devfn, int reg, int len, u32 val); | 525 | int reg, int len, u32 val); |
526 | 526 | ||
527 | struct pci_bus_region { | 527 | struct pci_bus_region { |
528 | resource_size_t start; | 528 | resource_size_t start; |
@@ -673,7 +673,7 @@ struct pci_driver { | |||
673 | /* these external functions are only available when PCI support is enabled */ | 673 | /* these external functions are only available when PCI support is enabled */ |
674 | #ifdef CONFIG_PCI | 674 | #ifdef CONFIG_PCI |
675 | 675 | ||
676 | extern void pcie_bus_configure_settings(struct pci_bus *bus, u8 smpss); | 676 | void pcie_bus_configure_settings(struct pci_bus *bus, u8 smpss); |
677 | 677 | ||
678 | enum pcie_bus_config_types { | 678 | enum pcie_bus_config_types { |
679 | PCIE_BUS_TUNE_OFF, | 679 | PCIE_BUS_TUNE_OFF, |
@@ -690,7 +690,7 @@ extern struct bus_type pci_bus_type; | |||
690 | * code, or pci core code. */ | 690 | * code, or pci core code. */ |
691 | extern struct list_head pci_root_buses; /* list of all known PCI buses */ | 691 | extern struct list_head pci_root_buses; /* list of all known PCI buses */ |
692 | /* Some device drivers need know if pci is initiated */ | 692 | /* Some device drivers need know if pci is initiated */ |
693 | extern int no_pci_devices(void); | 693 | int no_pci_devices(void); |
694 | 694 | ||
695 | void pcibios_resource_survey_bus(struct pci_bus *bus); | 695 | void pcibios_resource_survey_bus(struct pci_bus *bus); |
696 | void pcibios_add_bus(struct pci_bus *bus); | 696 | void pcibios_add_bus(struct pci_bus *bus); |
@@ -716,7 +716,7 @@ void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | |||
716 | void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | 716 | void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, |
717 | struct pci_bus_region *region); | 717 | struct pci_bus_region *region); |
718 | void pcibios_scan_specific_bus(int busn); | 718 | void pcibios_scan_specific_bus(int busn); |
719 | extern struct pci_bus *pci_find_bus(int domain, int busnr); | 719 | struct pci_bus *pci_find_bus(int domain, int busnr); |
720 | void pci_bus_add_devices(const struct pci_bus *bus); | 720 | void pci_bus_add_devices(const struct pci_bus *bus); |
721 | struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus, | 721 | struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus, |
722 | struct pci_ops *ops, void *sysdata); | 722 | struct pci_ops *ops, void *sysdata); |
@@ -749,14 +749,14 @@ struct resource *pci_find_parent_resource(const struct pci_dev *dev, | |||
749 | u8 pci_swizzle_interrupt_pin(const struct pci_dev *dev, u8 pin); | 749 | u8 pci_swizzle_interrupt_pin(const struct pci_dev *dev, u8 pin); |
750 | int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge); | 750 | int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge); |
751 | u8 pci_common_swizzle(struct pci_dev *dev, u8 *pinp); | 751 | u8 pci_common_swizzle(struct pci_dev *dev, u8 *pinp); |
752 | extern struct pci_dev *pci_dev_get(struct pci_dev *dev); | 752 | struct pci_dev *pci_dev_get(struct pci_dev *dev); |
753 | extern void pci_dev_put(struct pci_dev *dev); | 753 | void pci_dev_put(struct pci_dev *dev); |
754 | extern void pci_remove_bus(struct pci_bus *b); | 754 | void pci_remove_bus(struct pci_bus *b); |
755 | extern void pci_stop_and_remove_bus_device(struct pci_dev *dev); | 755 | void pci_stop_and_remove_bus_device(struct pci_dev *dev); |
756 | void pci_stop_root_bus(struct pci_bus *bus); | 756 | void pci_stop_root_bus(struct pci_bus *bus); |
757 | void pci_remove_root_bus(struct pci_bus *bus); | 757 | void pci_remove_root_bus(struct pci_bus *bus); |
758 | void pci_setup_cardbus(struct pci_bus *bus); | 758 | void pci_setup_cardbus(struct pci_bus *bus); |
759 | extern void pci_sort_breadthfirst(void); | 759 | void pci_sort_breadthfirst(void); |
760 | #define dev_is_pci(d) ((d)->bus == &pci_bus_type) | 760 | #define dev_is_pci(d) ((d)->bus == &pci_bus_type) |
761 | #define dev_is_pf(d) ((dev_is_pci(d) ? to_pci_dev(d)->is_physfn : false)) | 761 | #define dev_is_pf(d) ((dev_is_pci(d) ? to_pci_dev(d)->is_physfn : false)) |
762 | #define dev_num_vf(d) ((dev_is_pci(d) ? pci_num_vf(to_pci_dev(d)) : 0)) | 762 | #define dev_num_vf(d) ((dev_is_pci(d) ? pci_num_vf(to_pci_dev(d)) : 0)) |
@@ -1158,18 +1158,17 @@ static inline int pci_msi_enabled(void) | |||
1158 | return 0; | 1158 | return 0; |
1159 | } | 1159 | } |
1160 | #else | 1160 | #else |
1161 | extern int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec); | 1161 | int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec); |
1162 | extern int pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec); | 1162 | int pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec); |
1163 | extern void pci_msi_shutdown(struct pci_dev *dev); | 1163 | void pci_msi_shutdown(struct pci_dev *dev); |
1164 | extern void pci_disable_msi(struct pci_dev *dev); | 1164 | void pci_disable_msi(struct pci_dev *dev); |
1165 | extern int pci_msix_table_size(struct pci_dev *dev); | 1165 | int pci_msix_table_size(struct pci_dev *dev); |
1166 | extern int pci_enable_msix(struct pci_dev *dev, | 1166 | int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec); |
1167 | struct msix_entry *entries, int nvec); | 1167 | void pci_msix_shutdown(struct pci_dev *dev); |
1168 | extern void pci_msix_shutdown(struct pci_dev *dev); | 1168 | void pci_disable_msix(struct pci_dev *dev); |
1169 | extern void pci_disable_msix(struct pci_dev *dev); | 1169 | void msi_remove_pci_irq_vectors(struct pci_dev *dev); |
1170 | extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); | 1170 | void pci_restore_msi_state(struct pci_dev *dev); |
1171 | extern void pci_restore_msi_state(struct pci_dev *dev); | 1171 | int pci_msi_enabled(void); |
1172 | extern int pci_msi_enabled(void); | ||
1173 | #endif | 1172 | #endif |
1174 | 1173 | ||
1175 | #ifdef CONFIG_PCIEPORTBUS | 1174 | #ifdef CONFIG_PCIEPORTBUS |
@@ -1184,8 +1183,8 @@ extern bool pcie_ports_auto; | |||
1184 | static inline int pcie_aspm_enabled(void) { return 0; } | 1183 | static inline int pcie_aspm_enabled(void) { return 0; } |
1185 | static inline bool pcie_aspm_support_enabled(void) { return false; } | 1184 | static inline bool pcie_aspm_support_enabled(void) { return false; } |
1186 | #else | 1185 | #else |
1187 | extern int pcie_aspm_enabled(void); | 1186 | int pcie_aspm_enabled(void); |
1188 | extern bool pcie_aspm_support_enabled(void); | 1187 | bool pcie_aspm_support_enabled(void); |
1189 | #endif | 1188 | #endif |
1190 | 1189 | ||
1191 | #ifdef CONFIG_PCIEAER | 1190 | #ifdef CONFIG_PCIEAER |
@@ -1203,8 +1202,8 @@ static inline void pcie_set_ecrc_checking(struct pci_dev *dev) | |||
1203 | } | 1202 | } |
1204 | static inline void pcie_ecrc_get_policy(char *str) {}; | 1203 | static inline void pcie_ecrc_get_policy(char *str) {}; |
1205 | #else | 1204 | #else |
1206 | extern void pcie_set_ecrc_checking(struct pci_dev *dev); | 1205 | void pcie_set_ecrc_checking(struct pci_dev *dev); |
1207 | extern void pcie_ecrc_get_policy(char *str); | 1206 | void pcie_ecrc_get_policy(char *str); |
1208 | #endif | 1207 | #endif |
1209 | 1208 | ||
1210 | #define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1) | 1209 | #define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1) |
@@ -1215,9 +1214,9 @@ int ht_create_irq(struct pci_dev *dev, int idx); | |||
1215 | void ht_destroy_irq(unsigned int irq); | 1214 | void ht_destroy_irq(unsigned int irq); |
1216 | #endif /* CONFIG_HT_IRQ */ | 1215 | #endif /* CONFIG_HT_IRQ */ |
1217 | 1216 | ||
1218 | extern void pci_cfg_access_lock(struct pci_dev *dev); | 1217 | void pci_cfg_access_lock(struct pci_dev *dev); |
1219 | extern bool pci_cfg_access_trylock(struct pci_dev *dev); | 1218 | bool pci_cfg_access_trylock(struct pci_dev *dev); |
1220 | extern void pci_cfg_access_unlock(struct pci_dev *dev); | 1219 | void pci_cfg_access_unlock(struct pci_dev *dev); |
1221 | 1220 | ||
1222 | /* | 1221 | /* |
1223 | * PCI domain support. Sometimes called PCI segment (eg by ACPI), | 1222 | * PCI domain support. Sometimes called PCI segment (eg by ACPI), |
@@ -1242,7 +1241,7 @@ static inline int pci_proc_domain(struct pci_bus *bus) | |||
1242 | /* some architectures require additional setup to direct VGA traffic */ | 1241 | /* some architectures require additional setup to direct VGA traffic */ |
1243 | typedef int (*arch_set_vga_state_t)(struct pci_dev *pdev, bool decode, | 1242 | typedef int (*arch_set_vga_state_t)(struct pci_dev *pdev, bool decode, |
1244 | unsigned int command_bits, u32 flags); | 1243 | unsigned int command_bits, u32 flags); |
1245 | extern void pci_register_set_vga_state(arch_set_vga_state_t func); | 1244 | void pci_register_set_vga_state(arch_set_vga_state_t func); |
1246 | 1245 | ||
1247 | #else /* CONFIG_PCI is not enabled */ | 1246 | #else /* CONFIG_PCI is not enabled */ |
1248 | 1247 | ||
@@ -1644,8 +1643,8 @@ int pcibios_set_pcie_reset_state(struct pci_dev *dev, | |||
1644 | int pcibios_add_device(struct pci_dev *dev); | 1643 | int pcibios_add_device(struct pci_dev *dev); |
1645 | 1644 | ||
1646 | #ifdef CONFIG_PCI_MMCONFIG | 1645 | #ifdef CONFIG_PCI_MMCONFIG |
1647 | extern void __init pci_mmcfg_early_init(void); | 1646 | void __init pci_mmcfg_early_init(void); |
1648 | extern void __init pci_mmcfg_late_init(void); | 1647 | void __init pci_mmcfg_late_init(void); |
1649 | #else | 1648 | #else |
1650 | static inline void pci_mmcfg_early_init(void) { } | 1649 | static inline void pci_mmcfg_early_init(void) { } |
1651 | static inline void pci_mmcfg_late_init(void) { } | 1650 | static inline void pci_mmcfg_late_init(void) { } |
@@ -1656,12 +1655,12 @@ int pci_ext_cfg_avail(void); | |||
1656 | void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar); | 1655 | void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar); |
1657 | 1656 | ||
1658 | #ifdef CONFIG_PCI_IOV | 1657 | #ifdef CONFIG_PCI_IOV |
1659 | extern int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn); | 1658 | int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn); |
1660 | extern void pci_disable_sriov(struct pci_dev *dev); | 1659 | void pci_disable_sriov(struct pci_dev *dev); |
1661 | extern irqreturn_t pci_sriov_migration(struct pci_dev *dev); | 1660 | irqreturn_t pci_sriov_migration(struct pci_dev *dev); |
1662 | extern int pci_num_vf(struct pci_dev *dev); | 1661 | int pci_num_vf(struct pci_dev *dev); |
1663 | extern int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs); | 1662 | int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs); |
1664 | extern int pci_sriov_get_totalvfs(struct pci_dev *dev); | 1663 | int pci_sriov_get_totalvfs(struct pci_dev *dev); |
1665 | #else | 1664 | #else |
1666 | static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) | 1665 | static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) |
1667 | { | 1666 | { |
@@ -1689,8 +1688,8 @@ static inline int pci_sriov_get_totalvfs(struct pci_dev *dev) | |||
1689 | #endif | 1688 | #endif |
1690 | 1689 | ||
1691 | #if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) | 1690 | #if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) |
1692 | extern void pci_hp_create_module_link(struct pci_slot *pci_slot); | 1691 | void pci_hp_create_module_link(struct pci_slot *pci_slot); |
1693 | extern void pci_hp_remove_module_link(struct pci_slot *pci_slot); | 1692 | void pci_hp_remove_module_link(struct pci_slot *pci_slot); |
1694 | #endif | 1693 | #endif |
1695 | 1694 | ||
1696 | /** | 1695 | /** |
@@ -1834,13 +1833,13 @@ int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off, | |||
1834 | /* PCI <-> OF binding helpers */ | 1833 | /* PCI <-> OF binding helpers */ |
1835 | #ifdef CONFIG_OF | 1834 | #ifdef CONFIG_OF |
1836 | struct device_node; | 1835 | struct device_node; |
1837 | extern void pci_set_of_node(struct pci_dev *dev); | 1836 | void pci_set_of_node(struct pci_dev *dev); |
1838 | extern void pci_release_of_node(struct pci_dev *dev); | 1837 | void pci_release_of_node(struct pci_dev *dev); |
1839 | extern void pci_set_bus_of_node(struct pci_bus *bus); | 1838 | void pci_set_bus_of_node(struct pci_bus *bus); |
1840 | extern void pci_release_bus_of_node(struct pci_bus *bus); | 1839 | void pci_release_bus_of_node(struct pci_bus *bus); |
1841 | 1840 | ||
1842 | /* Arch may override this (weak) */ | 1841 | /* Arch may override this (weak) */ |
1843 | extern struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus); | 1842 | struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus); |
1844 | 1843 | ||
1845 | static inline struct device_node * | 1844 | static inline struct device_node * |
1846 | pci_device_to_OF_node(const struct pci_dev *pdev) | 1845 | pci_device_to_OF_node(const struct pci_dev *pdev) |