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 /drivers/pci | |
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 'drivers/pci')
-rw-r--r-- | drivers/pci/bus.c | 3 | ||||
-rw-r--r-- | drivers/pci/hotplug/acpiphp.h | 22 | ||||
-rw-r--r-- | drivers/pci/hotplug/cpci_hotplug.h | 44 | ||||
-rw-r--r-- | drivers/pci/hotplug/cpqphp.h | 70 | ||||
-rw-r--r-- | drivers/pci/hotplug/cpqphp_nvram.h | 12 | ||||
-rw-r--r-- | drivers/pci/hotplug/ibmphp.h | 66 | ||||
-rw-r--r-- | drivers/pci/hotplug/pci_hotplug_core.c | 15 | ||||
-rw-r--r-- | drivers/pci/hotplug/pciehp.h | 22 | ||||
-rw-r--r-- | drivers/pci/hotplug/rpadlpar.h | 8 | ||||
-rw-r--r-- | drivers/pci/hotplug/rpaphp.h | 16 | ||||
-rw-r--r-- | drivers/pci/hotplug/shpchp.h | 26 | ||||
-rw-r--r-- | drivers/pci/hotplug/shpchp_sysfs.c | 2 | ||||
-rw-r--r-- | drivers/pci/msi.c | 4 | ||||
-rw-r--r-- | drivers/pci/pci.c | 8 | ||||
-rw-r--r-- | drivers/pci/pci.h | 89 | ||||
-rw-r--r-- | drivers/pci/pcie/aer/aer_inject.c | 4 | ||||
-rw-r--r-- | drivers/pci/pcie/aer/aerdrv.h | 14 | ||||
-rw-r--r-- | drivers/pci/pcie/portdrv.h | 18 | ||||
-rw-r--r-- | drivers/pci/pcie/portdrv_acpi.c | 1 | ||||
-rw-r--r-- | drivers/pci/pcie/portdrv_pci.c | 17 | ||||
-rw-r--r-- | drivers/pci/setup-bus.c | 4 | ||||
-rw-r--r-- | drivers/pci/setup-res.c | 2 | ||||
-rw-r--r-- | drivers/pci/slot.c | 7 |
23 files changed, 232 insertions, 242 deletions
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index bdc1e8bf7e60..748f8f3e9ff5 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c | |||
@@ -202,6 +202,9 @@ void pci_bus_add_devices(const struct pci_bus *bus) | |||
202 | if (dev->is_added) | 202 | if (dev->is_added) |
203 | continue; | 203 | continue; |
204 | retval = pci_bus_add_device(dev); | 204 | retval = pci_bus_add_device(dev); |
205 | if (retval) | ||
206 | dev_err(&dev->dev, "Error adding device (%d)\n", | ||
207 | retval); | ||
205 | } | 208 | } |
206 | 209 | ||
207 | list_for_each_entry(dev, &bus->devices, bus_list) { | 210 | list_for_each_entry(dev, &bus->devices, bus_list) { |
diff --git a/drivers/pci/hotplug/acpiphp.h b/drivers/pci/hotplug/acpiphp.h index 6a319f42b30c..6fdd49c6f0b9 100644 --- a/drivers/pci/hotplug/acpiphp.h +++ b/drivers/pci/hotplug/acpiphp.h | |||
@@ -170,21 +170,21 @@ struct acpiphp_attention_info | |||
170 | /* function prototypes */ | 170 | /* function prototypes */ |
171 | 171 | ||
172 | /* acpiphp_core.c */ | 172 | /* acpiphp_core.c */ |
173 | extern int acpiphp_register_attention(struct acpiphp_attention_info*info); | 173 | int acpiphp_register_attention(struct acpiphp_attention_info*info); |
174 | extern int acpiphp_unregister_attention(struct acpiphp_attention_info *info); | 174 | int acpiphp_unregister_attention(struct acpiphp_attention_info *info); |
175 | extern int acpiphp_register_hotplug_slot(struct acpiphp_slot *slot); | 175 | int acpiphp_register_hotplug_slot(struct acpiphp_slot *slot); |
176 | extern void acpiphp_unregister_hotplug_slot(struct acpiphp_slot *slot); | 176 | void acpiphp_unregister_hotplug_slot(struct acpiphp_slot *slot); |
177 | 177 | ||
178 | /* acpiphp_glue.c */ | 178 | /* acpiphp_glue.c */ |
179 | typedef int (*acpiphp_callback)(struct acpiphp_slot *slot, void *data); | 179 | typedef int (*acpiphp_callback)(struct acpiphp_slot *slot, void *data); |
180 | 180 | ||
181 | extern int acpiphp_enable_slot (struct acpiphp_slot *slot); | 181 | int acpiphp_enable_slot(struct acpiphp_slot *slot); |
182 | extern int acpiphp_disable_slot (struct acpiphp_slot *slot); | 182 | int acpiphp_disable_slot(struct acpiphp_slot *slot); |
183 | extern int acpiphp_eject_slot (struct acpiphp_slot *slot); | 183 | int acpiphp_eject_slot(struct acpiphp_slot *slot); |
184 | extern u8 acpiphp_get_power_status (struct acpiphp_slot *slot); | 184 | u8 acpiphp_get_power_status(struct acpiphp_slot *slot); |
185 | extern u8 acpiphp_get_attention_status (struct acpiphp_slot *slot); | 185 | u8 acpiphp_get_attention_status(struct acpiphp_slot *slot); |
186 | extern u8 acpiphp_get_latch_status (struct acpiphp_slot *slot); | 186 | u8 acpiphp_get_latch_status(struct acpiphp_slot *slot); |
187 | extern u8 acpiphp_get_adapter_status (struct acpiphp_slot *slot); | 187 | u8 acpiphp_get_adapter_status(struct acpiphp_slot *slot); |
188 | 188 | ||
189 | /* variables */ | 189 | /* variables */ |
190 | extern bool acpiphp_debug; | 190 | extern bool acpiphp_debug; |
diff --git a/drivers/pci/hotplug/cpci_hotplug.h b/drivers/pci/hotplug/cpci_hotplug.h index 9fff878cf026..1356211431d0 100644 --- a/drivers/pci/hotplug/cpci_hotplug.h +++ b/drivers/pci/hotplug/cpci_hotplug.h | |||
@@ -75,28 +75,36 @@ static inline const char *slot_name(struct slot *slot) | |||
75 | return hotplug_slot_name(slot->hotplug_slot); | 75 | return hotplug_slot_name(slot->hotplug_slot); |
76 | } | 76 | } |
77 | 77 | ||
78 | extern int cpci_hp_register_controller(struct cpci_hp_controller *controller); | 78 | int cpci_hp_register_controller(struct cpci_hp_controller *controller); |
79 | extern int cpci_hp_unregister_controller(struct cpci_hp_controller *controller); | 79 | int cpci_hp_unregister_controller(struct cpci_hp_controller *controller); |
80 | extern int cpci_hp_register_bus(struct pci_bus *bus, u8 first, u8 last); | 80 | int cpci_hp_register_bus(struct pci_bus *bus, u8 first, u8 last); |
81 | extern int cpci_hp_unregister_bus(struct pci_bus *bus); | 81 | int cpci_hp_unregister_bus(struct pci_bus *bus); |
82 | extern int cpci_hp_start(void); | 82 | int cpci_hp_start(void); |
83 | extern int cpci_hp_stop(void); | 83 | int cpci_hp_stop(void); |
84 | 84 | ||
85 | /* | 85 | /* |
86 | * Internal function prototypes, these functions should not be used by | 86 | * Internal function prototypes, these functions should not be used by |
87 | * board/chassis drivers. | 87 | * board/chassis drivers. |
88 | */ | 88 | */ |
89 | extern u8 cpci_get_attention_status(struct slot *slot); | 89 | u8 cpci_get_attention_status(struct slot *slot); |
90 | extern u8 cpci_get_latch_status(struct slot *slot); | 90 | u8 cpci_get_latch_status(struct slot *slot); |
91 | extern u8 cpci_get_adapter_status(struct slot *slot); | 91 | u8 cpci_get_adapter_status(struct slot *slot); |
92 | extern u16 cpci_get_hs_csr(struct slot * slot); | 92 | u16 cpci_get_hs_csr(struct slot * slot); |
93 | extern int cpci_set_attention_status(struct slot *slot, int status); | 93 | int cpci_set_attention_status(struct slot *slot, int status); |
94 | extern int cpci_check_and_clear_ins(struct slot * slot); | 94 | int cpci_check_and_clear_ins(struct slot * slot); |
95 | extern int cpci_check_ext(struct slot * slot); | 95 | int cpci_check_ext(struct slot * slot); |
96 | extern int cpci_clear_ext(struct slot * slot); | 96 | int cpci_clear_ext(struct slot * slot); |
97 | extern int cpci_led_on(struct slot * slot); | 97 | int cpci_led_on(struct slot * slot); |
98 | extern int cpci_led_off(struct slot * slot); | 98 | int cpci_led_off(struct slot * slot); |
99 | extern int cpci_configure_slot(struct slot *slot); | 99 | int cpci_configure_slot(struct slot *slot); |
100 | extern int cpci_unconfigure_slot(struct slot *slot); | 100 | int cpci_unconfigure_slot(struct slot *slot); |
101 | |||
102 | #ifdef CONFIG_HOTPLUG_PCI_CPCI | ||
103 | int cpci_hotplug_init(int debug); | ||
104 | void cpci_hotplug_exit(void); | ||
105 | #else | ||
106 | static inline int cpci_hotplug_init(int debug) { return 0; } | ||
107 | static inline void cpci_hotplug_exit(void) { } | ||
108 | #endif | ||
101 | 109 | ||
102 | #endif /* _CPCI_HOTPLUG_H */ | 110 | #endif /* _CPCI_HOTPLUG_H */ |
diff --git a/drivers/pci/hotplug/cpqphp.h b/drivers/pci/hotplug/cpqphp.h index d8ffc7366801..516b87738b6e 100644 --- a/drivers/pci/hotplug/cpqphp.h +++ b/drivers/pci/hotplug/cpqphp.h | |||
@@ -404,50 +404,44 @@ struct resource_lists { | |||
404 | 404 | ||
405 | 405 | ||
406 | /* debugfs functions for the hotplug controller info */ | 406 | /* debugfs functions for the hotplug controller info */ |
407 | extern void cpqhp_initialize_debugfs(void); | 407 | void cpqhp_initialize_debugfs(void); |
408 | extern void cpqhp_shutdown_debugfs(void); | 408 | void cpqhp_shutdown_debugfs(void); |
409 | extern void cpqhp_create_debugfs_files(struct controller *ctrl); | 409 | void cpqhp_create_debugfs_files(struct controller *ctrl); |
410 | extern void cpqhp_remove_debugfs_files(struct controller *ctrl); | 410 | void cpqhp_remove_debugfs_files(struct controller *ctrl); |
411 | 411 | ||
412 | /* controller functions */ | 412 | /* controller functions */ |
413 | extern void cpqhp_pushbutton_thread(unsigned long event_pointer); | 413 | void cpqhp_pushbutton_thread(unsigned long event_pointer); |
414 | extern irqreturn_t cpqhp_ctrl_intr(int IRQ, void *data); | 414 | irqreturn_t cpqhp_ctrl_intr(int IRQ, void *data); |
415 | extern int cpqhp_find_available_resources(struct controller *ctrl, | 415 | int cpqhp_find_available_resources(struct controller *ctrl, |
416 | void __iomem *rom_start); | 416 | void __iomem *rom_start); |
417 | extern int cpqhp_event_start_thread(void); | 417 | int cpqhp_event_start_thread(void); |
418 | extern void cpqhp_event_stop_thread(void); | 418 | void cpqhp_event_stop_thread(void); |
419 | extern struct pci_func *cpqhp_slot_create(unsigned char busnumber); | 419 | struct pci_func *cpqhp_slot_create(unsigned char busnumber); |
420 | extern struct pci_func *cpqhp_slot_find(unsigned char bus, unsigned char device, | 420 | struct pci_func *cpqhp_slot_find(unsigned char bus, unsigned char device, |
421 | unsigned char index); | 421 | unsigned char index); |
422 | extern int cpqhp_process_SI(struct controller *ctrl, struct pci_func *func); | 422 | int cpqhp_process_SI(struct controller *ctrl, struct pci_func *func); |
423 | extern int cpqhp_process_SS(struct controller *ctrl, struct pci_func *func); | 423 | int cpqhp_process_SS(struct controller *ctrl, struct pci_func *func); |
424 | extern int cpqhp_hardware_test(struct controller *ctrl, int test_num); | 424 | int cpqhp_hardware_test(struct controller *ctrl, int test_num); |
425 | 425 | ||
426 | /* resource functions */ | 426 | /* resource functions */ |
427 | extern int cpqhp_resource_sort_and_combine (struct pci_resource **head); | 427 | int cpqhp_resource_sort_and_combine (struct pci_resource **head); |
428 | 428 | ||
429 | /* pci functions */ | 429 | /* pci functions */ |
430 | extern int cpqhp_set_irq(u8 bus_num, u8 dev_num, u8 int_pin, u8 irq_num); | 430 | int cpqhp_set_irq(u8 bus_num, u8 dev_num, u8 int_pin, u8 irq_num); |
431 | extern int cpqhp_get_bus_dev(struct controller *ctrl, u8 *bus_num, u8 *dev_num, | 431 | int cpqhp_get_bus_dev(struct controller *ctrl, u8 *bus_num, u8 *dev_num, |
432 | u8 slot); | 432 | u8 slot); |
433 | extern int cpqhp_save_config(struct controller *ctrl, int busnumber, | 433 | int cpqhp_save_config(struct controller *ctrl, int busnumber, int is_hot_plug); |
434 | int is_hot_plug); | 434 | int cpqhp_save_base_addr_length(struct controller *ctrl, struct pci_func *func); |
435 | extern int cpqhp_save_base_addr_length(struct controller *ctrl, | 435 | int cpqhp_save_used_resources(struct controller *ctrl, struct pci_func *func); |
436 | struct pci_func *func); | 436 | int cpqhp_configure_board(struct controller *ctrl, struct pci_func *func); |
437 | extern int cpqhp_save_used_resources(struct controller *ctrl, | 437 | int cpqhp_save_slot_config(struct controller *ctrl, struct pci_func *new_slot); |
438 | struct pci_func *func); | 438 | int cpqhp_valid_replace(struct controller *ctrl, struct pci_func *func); |
439 | extern int cpqhp_configure_board(struct controller *ctrl, | 439 | void cpqhp_destroy_board_resources(struct pci_func *func); |
440 | struct pci_func *func); | 440 | int cpqhp_return_board_resources(struct pci_func *func, |
441 | extern int cpqhp_save_slot_config(struct controller *ctrl, | 441 | struct resource_lists *resources); |
442 | struct pci_func *new_slot); | 442 | void cpqhp_destroy_resource_list(struct resource_lists *resources); |
443 | extern int cpqhp_valid_replace(struct controller *ctrl, struct pci_func *func); | 443 | int cpqhp_configure_device(struct controller *ctrl, struct pci_func *func); |
444 | extern void cpqhp_destroy_board_resources(struct pci_func *func); | 444 | int cpqhp_unconfigure_device(struct pci_func *func); |
445 | extern int cpqhp_return_board_resources (struct pci_func *func, | ||
446 | struct resource_lists *resources); | ||
447 | extern void cpqhp_destroy_resource_list(struct resource_lists *resources); | ||
448 | extern int cpqhp_configure_device(struct controller *ctrl, | ||
449 | struct pci_func *func); | ||
450 | extern int cpqhp_unconfigure_device(struct pci_func *func); | ||
451 | 445 | ||
452 | /* Global variables */ | 446 | /* Global variables */ |
453 | extern int cpqhp_debug; | 447 | extern int cpqhp_debug; |
diff --git a/drivers/pci/hotplug/cpqphp_nvram.h b/drivers/pci/hotplug/cpqphp_nvram.h index e89c0702119d..34e4e54fcf15 100644 --- a/drivers/pci/hotplug/cpqphp_nvram.h +++ b/drivers/pci/hotplug/cpqphp_nvram.h | |||
@@ -30,26 +30,26 @@ | |||
30 | 30 | ||
31 | #ifndef CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM | 31 | #ifndef CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM |
32 | 32 | ||
33 | static inline void compaq_nvram_init (void __iomem *rom_start) | 33 | static inline void compaq_nvram_init(void __iomem *rom_start) |
34 | { | 34 | { |
35 | return; | 35 | return; |
36 | } | 36 | } |
37 | 37 | ||
38 | static inline int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl) | 38 | static inline int compaq_nvram_load(void __iomem *rom_start, struct controller *ctrl) |
39 | { | 39 | { |
40 | return 0; | 40 | return 0; |
41 | } | 41 | } |
42 | 42 | ||
43 | static inline int compaq_nvram_store (void __iomem *rom_start) | 43 | static inline int compaq_nvram_store(void __iomem *rom_start) |
44 | { | 44 | { |
45 | return 0; | 45 | return 0; |
46 | } | 46 | } |
47 | 47 | ||
48 | #else | 48 | #else |
49 | 49 | ||
50 | extern void compaq_nvram_init (void __iomem *rom_start); | 50 | void compaq_nvram_init(void __iomem *rom_start); |
51 | extern int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl); | 51 | int compaq_nvram_load(void __iomem *rom_start, struct controller *ctrl); |
52 | extern int compaq_nvram_store (void __iomem *rom_start); | 52 | int compaq_nvram_store(void __iomem *rom_start); |
53 | 53 | ||
54 | #endif | 54 | #endif |
55 | 55 | ||
diff --git a/drivers/pci/hotplug/ibmphp.h b/drivers/pci/hotplug/ibmphp.h index a8d391a4957d..8c5b25871d02 100644 --- a/drivers/pci/hotplug/ibmphp.h +++ b/drivers/pci/hotplug/ibmphp.h | |||
@@ -275,17 +275,17 @@ extern struct list_head ibmphp_slot_head; | |||
275 | * FUNCTION PROTOTYPES * | 275 | * FUNCTION PROTOTYPES * |
276 | ***********************************************************/ | 276 | ***********************************************************/ |
277 | 277 | ||
278 | extern void ibmphp_free_ebda_hpc_queue (void); | 278 | void ibmphp_free_ebda_hpc_queue(void); |
279 | extern int ibmphp_access_ebda (void); | 279 | int ibmphp_access_ebda(void); |
280 | extern struct slot *ibmphp_get_slot_from_physical_num (u8); | 280 | struct slot *ibmphp_get_slot_from_physical_num(u8); |
281 | extern int ibmphp_get_total_hp_slots (void); | 281 | int ibmphp_get_total_hp_slots(void); |
282 | extern void ibmphp_free_ibm_slot (struct slot *); | 282 | void ibmphp_free_ibm_slot(struct slot *); |
283 | extern void ibmphp_free_bus_info_queue (void); | 283 | void ibmphp_free_bus_info_queue(void); |
284 | extern void ibmphp_free_ebda_pci_rsrc_queue (void); | 284 | void ibmphp_free_ebda_pci_rsrc_queue(void); |
285 | extern struct bus_info *ibmphp_find_same_bus_num (u32); | 285 | struct bus_info *ibmphp_find_same_bus_num(u32); |
286 | extern int ibmphp_get_bus_index (u8); | 286 | int ibmphp_get_bus_index(u8); |
287 | extern u16 ibmphp_get_total_controllers (void); | 287 | u16 ibmphp_get_total_controllers(void); |
288 | extern int ibmphp_register_pci (void); | 288 | int ibmphp_register_pci(void); |
289 | 289 | ||
290 | /* passed parameters */ | 290 | /* passed parameters */ |
291 | #define MEM 0 | 291 | #define MEM 0 |
@@ -381,24 +381,24 @@ struct res_needed { | |||
381 | 381 | ||
382 | /* functions */ | 382 | /* functions */ |
383 | 383 | ||
384 | extern int ibmphp_rsrc_init (void); | 384 | int ibmphp_rsrc_init(void); |
385 | extern int ibmphp_add_resource (struct resource_node *); | 385 | int ibmphp_add_resource(struct resource_node *); |
386 | extern int ibmphp_remove_resource (struct resource_node *); | 386 | int ibmphp_remove_resource(struct resource_node *); |
387 | extern int ibmphp_find_resource (struct bus_node *, u32, struct resource_node **, int); | 387 | int ibmphp_find_resource(struct bus_node *, u32, struct resource_node **, int); |
388 | extern int ibmphp_check_resource (struct resource_node *, u8); | 388 | int ibmphp_check_resource(struct resource_node *, u8); |
389 | extern int ibmphp_remove_bus (struct bus_node *, u8); | 389 | int ibmphp_remove_bus(struct bus_node *, u8); |
390 | extern void ibmphp_free_resources (void); | 390 | void ibmphp_free_resources(void); |
391 | extern int ibmphp_add_pfmem_from_mem (struct resource_node *); | 391 | int ibmphp_add_pfmem_from_mem(struct resource_node *); |
392 | extern struct bus_node *ibmphp_find_res_bus (u8); | 392 | struct bus_node *ibmphp_find_res_bus(u8); |
393 | extern void ibmphp_print_test (void); /* for debugging purposes */ | 393 | void ibmphp_print_test(void); /* for debugging purposes */ |
394 | 394 | ||
395 | extern void ibmphp_hpc_initvars (void); | 395 | void ibmphp_hpc_initvars(void); |
396 | extern int ibmphp_hpc_readslot (struct slot *, u8, u8 *); | 396 | int ibmphp_hpc_readslot(struct slot *, u8, u8 *); |
397 | extern int ibmphp_hpc_writeslot (struct slot *, u8); | 397 | int ibmphp_hpc_writeslot(struct slot *, u8); |
398 | extern void ibmphp_lock_operations (void); | 398 | void ibmphp_lock_operations(void); |
399 | extern void ibmphp_unlock_operations (void); | 399 | void ibmphp_unlock_operations(void); |
400 | extern int ibmphp_hpc_start_poll_thread (void); | 400 | int ibmphp_hpc_start_poll_thread(void); |
401 | extern void ibmphp_hpc_stop_poll_thread (void); | 401 | void ibmphp_hpc_stop_poll_thread(void); |
402 | 402 | ||
403 | //---------------------------------------------------------------------------- | 403 | //---------------------------------------------------------------------------- |
404 | 404 | ||
@@ -749,11 +749,11 @@ struct controller { | |||
749 | 749 | ||
750 | /* Functions */ | 750 | /* Functions */ |
751 | 751 | ||
752 | extern int ibmphp_init_devno (struct slot **); /* This function is called from EBDA, so we need it not be static */ | 752 | int ibmphp_init_devno(struct slot **); /* This function is called from EBDA, so we need it not be static */ |
753 | extern int ibmphp_do_disable_slot (struct slot *slot_cur); | 753 | int ibmphp_do_disable_slot(struct slot *slot_cur); |
754 | extern int ibmphp_update_slot_info (struct slot *); /* This function is called from HPC, so we need it to not be be static */ | 754 | int ibmphp_update_slot_info(struct slot *); /* This function is called from HPC, so we need it to not be be static */ |
755 | extern int ibmphp_configure_card (struct pci_func *, u8); | 755 | int ibmphp_configure_card(struct pci_func *, u8); |
756 | extern int ibmphp_unconfigure_card (struct slot **, int); | 756 | int ibmphp_unconfigure_card(struct slot **, int); |
757 | extern struct hotplug_slot_ops ibmphp_hotplug_slot_ops; | 757 | extern struct hotplug_slot_ops ibmphp_hotplug_slot_ops; |
758 | 758 | ||
759 | #endif //__IBMPHP_H | 759 | #endif //__IBMPHP_H |
diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c index 202f4a969eb5..ec20f74c8981 100644 --- a/drivers/pci/hotplug/pci_hotplug_core.c +++ b/drivers/pci/hotplug/pci_hotplug_core.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <linux/pci_hotplug.h> | 41 | #include <linux/pci_hotplug.h> |
42 | #include <asm/uaccess.h> | 42 | #include <asm/uaccess.h> |
43 | #include "../pci.h" | 43 | #include "../pci.h" |
44 | #include "cpci_hotplug.h" | ||
44 | 45 | ||
45 | #define MY_NAME "pci_hotplug" | 46 | #define MY_NAME "pci_hotplug" |
46 | 47 | ||
@@ -63,14 +64,6 @@ static bool debug; | |||
63 | static LIST_HEAD(pci_hotplug_slot_list); | 64 | static LIST_HEAD(pci_hotplug_slot_list); |
64 | static DEFINE_MUTEX(pci_hp_mutex); | 65 | static DEFINE_MUTEX(pci_hp_mutex); |
65 | 66 | ||
66 | #ifdef CONFIG_HOTPLUG_PCI_CPCI | ||
67 | extern int cpci_hotplug_init(int debug); | ||
68 | extern void cpci_hotplug_exit(void); | ||
69 | #else | ||
70 | static inline int cpci_hotplug_init(int debug) { return 0; } | ||
71 | static inline void cpci_hotplug_exit(void) { } | ||
72 | #endif | ||
73 | |||
74 | /* Weee, fun with macros... */ | 67 | /* Weee, fun with macros... */ |
75 | #define GET_STATUS(name,type) \ | 68 | #define GET_STATUS(name,type) \ |
76 | static int get_##name (struct hotplug_slot *slot, type *value) \ | 69 | static int get_##name (struct hotplug_slot *slot, type *value) \ |
@@ -524,13 +517,11 @@ int pci_hp_deregister(struct hotplug_slot *hotplug) | |||
524 | * | 517 | * |
525 | * Returns 0 if successful, anything else for an error. | 518 | * Returns 0 if successful, anything else for an error. |
526 | */ | 519 | */ |
527 | int __must_check pci_hp_change_slot_info(struct hotplug_slot *hotplug, | 520 | int pci_hp_change_slot_info(struct hotplug_slot *hotplug, |
528 | struct hotplug_slot_info *info) | 521 | struct hotplug_slot_info *info) |
529 | { | 522 | { |
530 | struct pci_slot *slot; | ||
531 | if (!hotplug || !info) | 523 | if (!hotplug || !info) |
532 | return -ENODEV; | 524 | return -ENODEV; |
533 | slot = hotplug->pci_slot; | ||
534 | 525 | ||
535 | memcpy(hotplug->info, info, sizeof(struct hotplug_slot_info)); | 526 | memcpy(hotplug->info, info, sizeof(struct hotplug_slot_info)); |
536 | 527 | ||
diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h index 2c113de94323..7fb326983ed6 100644 --- a/drivers/pci/hotplug/pciehp.h +++ b/drivers/pci/hotplug/pciehp.h | |||
@@ -127,15 +127,15 @@ struct controller { | |||
127 | #define NO_CMD_CMPL(ctrl) ((ctrl)->slot_cap & PCI_EXP_SLTCAP_NCCS) | 127 | #define NO_CMD_CMPL(ctrl) ((ctrl)->slot_cap & PCI_EXP_SLTCAP_NCCS) |
128 | #define PSN(ctrl) ((ctrl)->slot_cap >> 19) | 128 | #define PSN(ctrl) ((ctrl)->slot_cap >> 19) |
129 | 129 | ||
130 | extern int pciehp_sysfs_enable_slot(struct slot *slot); | 130 | int pciehp_sysfs_enable_slot(struct slot *slot); |
131 | extern int pciehp_sysfs_disable_slot(struct slot *slot); | 131 | int pciehp_sysfs_disable_slot(struct slot *slot); |
132 | extern u8 pciehp_handle_attention_button(struct slot *p_slot); | 132 | u8 pciehp_handle_attention_button(struct slot *p_slot); |
133 | extern u8 pciehp_handle_switch_change(struct slot *p_slot); | 133 | u8 pciehp_handle_switch_change(struct slot *p_slot); |
134 | extern u8 pciehp_handle_presence_change(struct slot *p_slot); | 134 | u8 pciehp_handle_presence_change(struct slot *p_slot); |
135 | extern u8 pciehp_handle_power_fault(struct slot *p_slot); | 135 | u8 pciehp_handle_power_fault(struct slot *p_slot); |
136 | extern int pciehp_configure_device(struct slot *p_slot); | 136 | int pciehp_configure_device(struct slot *p_slot); |
137 | extern int pciehp_unconfigure_device(struct slot *p_slot); | 137 | int pciehp_unconfigure_device(struct slot *p_slot); |
138 | extern void pciehp_queue_pushbutton_work(struct work_struct *work); | 138 | void pciehp_queue_pushbutton_work(struct work_struct *work); |
139 | struct controller *pcie_init(struct pcie_device *dev); | 139 | struct controller *pcie_init(struct pcie_device *dev); |
140 | int pcie_init_notification(struct controller *ctrl); | 140 | int pcie_init_notification(struct controller *ctrl); |
141 | int pciehp_enable_slot(struct slot *p_slot); | 141 | int pciehp_enable_slot(struct slot *p_slot); |
@@ -166,8 +166,8 @@ static inline const char *slot_name(struct slot *slot) | |||
166 | #include <acpi/acpi_bus.h> | 166 | #include <acpi/acpi_bus.h> |
167 | #include <linux/pci-acpi.h> | 167 | #include <linux/pci-acpi.h> |
168 | 168 | ||
169 | extern void __init pciehp_acpi_slot_detection_init(void); | 169 | void __init pciehp_acpi_slot_detection_init(void); |
170 | extern int pciehp_acpi_slot_detection_check(struct pci_dev *dev); | 170 | int pciehp_acpi_slot_detection_check(struct pci_dev *dev); |
171 | 171 | ||
172 | static inline void pciehp_firmware_init(void) | 172 | static inline void pciehp_firmware_init(void) |
173 | { | 173 | { |
diff --git a/drivers/pci/hotplug/rpadlpar.h b/drivers/pci/hotplug/rpadlpar.h index 4a0a59b82eae..81df93931ad0 100644 --- a/drivers/pci/hotplug/rpadlpar.h +++ b/drivers/pci/hotplug/rpadlpar.h | |||
@@ -15,10 +15,10 @@ | |||
15 | #ifndef _RPADLPAR_IO_H_ | 15 | #ifndef _RPADLPAR_IO_H_ |
16 | #define _RPADLPAR_IO_H_ | 16 | #define _RPADLPAR_IO_H_ |
17 | 17 | ||
18 | extern int dlpar_sysfs_init(void); | 18 | int dlpar_sysfs_init(void); |
19 | extern void dlpar_sysfs_exit(void); | 19 | void dlpar_sysfs_exit(void); |
20 | 20 | ||
21 | extern int dlpar_add_slot(char *drc_name); | 21 | int dlpar_add_slot(char *drc_name); |
22 | extern int dlpar_remove_slot(char *drc_name); | 22 | int dlpar_remove_slot(char *drc_name); |
23 | 23 | ||
24 | #endif | 24 | #endif |
diff --git a/drivers/pci/hotplug/rpaphp.h b/drivers/pci/hotplug/rpaphp.h index df5677440a08..3135856e5e1c 100644 --- a/drivers/pci/hotplug/rpaphp.h +++ b/drivers/pci/hotplug/rpaphp.h | |||
@@ -86,18 +86,18 @@ extern struct list_head rpaphp_slot_head; | |||
86 | /* function prototypes */ | 86 | /* function prototypes */ |
87 | 87 | ||
88 | /* rpaphp_pci.c */ | 88 | /* rpaphp_pci.c */ |
89 | extern int rpaphp_enable_slot(struct slot *slot); | 89 | int rpaphp_enable_slot(struct slot *slot); |
90 | extern int rpaphp_get_sensor_state(struct slot *slot, int *state); | 90 | int rpaphp_get_sensor_state(struct slot *slot, int *state); |
91 | 91 | ||
92 | /* rpaphp_core.c */ | 92 | /* rpaphp_core.c */ |
93 | extern int rpaphp_add_slot(struct device_node *dn); | 93 | int rpaphp_add_slot(struct device_node *dn); |
94 | extern int rpaphp_get_drc_props(struct device_node *dn, int *drc_index, | 94 | int rpaphp_get_drc_props(struct device_node *dn, int *drc_index, |
95 | char **drc_name, char **drc_type, int *drc_power_domain); | 95 | char **drc_name, char **drc_type, int *drc_power_domain); |
96 | 96 | ||
97 | /* rpaphp_slot.c */ | 97 | /* rpaphp_slot.c */ |
98 | extern void dealloc_slot_struct(struct slot *slot); | 98 | void dealloc_slot_struct(struct slot *slot); |
99 | extern struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_name, int power_domain); | 99 | struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_name, int power_domain); |
100 | extern int rpaphp_register_slot(struct slot *slot); | 100 | int rpaphp_register_slot(struct slot *slot); |
101 | extern int rpaphp_deregister_slot(struct slot *slot); | 101 | int rpaphp_deregister_slot(struct slot *slot); |
102 | 102 | ||
103 | #endif /* _PPC64PHP_H */ | 103 | #endif /* _PPC64PHP_H */ |
diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h index b849f995075a..e260f207a90e 100644 --- a/drivers/pci/hotplug/shpchp.h +++ b/drivers/pci/hotplug/shpchp.h | |||
@@ -168,19 +168,19 @@ struct controller { | |||
168 | #define WRONG_BUS_FREQUENCY 0x0000000D | 168 | #define WRONG_BUS_FREQUENCY 0x0000000D |
169 | #define POWER_FAILURE 0x0000000E | 169 | #define POWER_FAILURE 0x0000000E |
170 | 170 | ||
171 | extern int __must_check shpchp_create_ctrl_files(struct controller *ctrl); | 171 | int __must_check shpchp_create_ctrl_files(struct controller *ctrl); |
172 | extern void shpchp_remove_ctrl_files(struct controller *ctrl); | 172 | void shpchp_remove_ctrl_files(struct controller *ctrl); |
173 | extern int shpchp_sysfs_enable_slot(struct slot *slot); | 173 | int shpchp_sysfs_enable_slot(struct slot *slot); |
174 | extern int shpchp_sysfs_disable_slot(struct slot *slot); | 174 | int shpchp_sysfs_disable_slot(struct slot *slot); |
175 | extern u8 shpchp_handle_attention_button(u8 hp_slot, struct controller *ctrl); | 175 | u8 shpchp_handle_attention_button(u8 hp_slot, struct controller *ctrl); |
176 | extern u8 shpchp_handle_switch_change(u8 hp_slot, struct controller *ctrl); | 176 | u8 shpchp_handle_switch_change(u8 hp_slot, struct controller *ctrl); |
177 | extern u8 shpchp_handle_presence_change(u8 hp_slot, struct controller *ctrl); | 177 | u8 shpchp_handle_presence_change(u8 hp_slot, struct controller *ctrl); |
178 | extern u8 shpchp_handle_power_fault(u8 hp_slot, struct controller *ctrl); | 178 | u8 shpchp_handle_power_fault(u8 hp_slot, struct controller *ctrl); |
179 | extern int shpchp_configure_device(struct slot *p_slot); | 179 | int shpchp_configure_device(struct slot *p_slot); |
180 | extern int shpchp_unconfigure_device(struct slot *p_slot); | 180 | int shpchp_unconfigure_device(struct slot *p_slot); |
181 | extern void cleanup_slots(struct controller *ctrl); | 181 | void cleanup_slots(struct controller *ctrl); |
182 | extern void shpchp_queue_pushbutton_work(struct work_struct *work); | 182 | void shpchp_queue_pushbutton_work(struct work_struct *work); |
183 | extern int shpc_init( struct controller *ctrl, struct pci_dev *pdev); | 183 | int shpc_init( struct controller *ctrl, struct pci_dev *pdev); |
184 | 184 | ||
185 | static inline const char *slot_name(struct slot *slot) | 185 | static inline const char *slot_name(struct slot *slot) |
186 | { | 186 | { |
diff --git a/drivers/pci/hotplug/shpchp_sysfs.c b/drivers/pci/hotplug/shpchp_sysfs.c index eeb23ceae4a8..e8c31fe20566 100644 --- a/drivers/pci/hotplug/shpchp_sysfs.c +++ b/drivers/pci/hotplug/shpchp_sysfs.c | |||
@@ -85,7 +85,7 @@ static ssize_t show_ctrl (struct device *dev, struct device_attribute *attr, cha | |||
85 | } | 85 | } |
86 | static DEVICE_ATTR (ctrl, S_IRUGO, show_ctrl, NULL); | 86 | static DEVICE_ATTR (ctrl, S_IRUGO, show_ctrl, NULL); |
87 | 87 | ||
88 | int __must_check shpchp_create_ctrl_files (struct controller *ctrl) | 88 | int shpchp_create_ctrl_files (struct controller *ctrl) |
89 | { | 89 | { |
90 | return device_create_file (&ctrl->pci_dev->dev, &dev_attr_ctrl); | 90 | return device_create_file (&ctrl->pci_dev->dev, &dev_attr_ctrl); |
91 | } | 91 | } |
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 00cc78c7aa04..bbff7d5a9b35 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c | |||
@@ -484,12 +484,12 @@ static struct msi_attribute mode_attribute = | |||
484 | __ATTR(mode, S_IRUGO, show_msi_mode, NULL); | 484 | __ATTR(mode, S_IRUGO, show_msi_mode, NULL); |
485 | 485 | ||
486 | 486 | ||
487 | struct attribute *msi_irq_default_attrs[] = { | 487 | static struct attribute *msi_irq_default_attrs[] = { |
488 | &mode_attribute.attr, | 488 | &mode_attribute.attr, |
489 | NULL | 489 | NULL |
490 | }; | 490 | }; |
491 | 491 | ||
492 | void msi_kobj_release(struct kobject *kobj) | 492 | static void msi_kobj_release(struct kobject *kobj) |
493 | { | 493 | { |
494 | struct msi_desc *entry = to_msi_desc(kobj); | 494 | struct msi_desc *entry = to_msi_desc(kobj); |
495 | 495 | ||
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index b099e0025d2b..f0ef3997ed3b 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -2619,7 +2619,7 @@ void pci_release_selected_regions(struct pci_dev *pdev, int bars) | |||
2619 | pci_release_region(pdev, i); | 2619 | pci_release_region(pdev, i); |
2620 | } | 2620 | } |
2621 | 2621 | ||
2622 | int __pci_request_selected_regions(struct pci_dev *pdev, int bars, | 2622 | static int __pci_request_selected_regions(struct pci_dev *pdev, int bars, |
2623 | const char *res_name, int excl) | 2623 | const char *res_name, int excl) |
2624 | { | 2624 | { |
2625 | int i; | 2625 | int i; |
@@ -3699,7 +3699,7 @@ static DEFINE_SPINLOCK(resource_alignment_lock); | |||
3699 | * RETURNS: Resource alignment if it is specified. | 3699 | * RETURNS: Resource alignment if it is specified. |
3700 | * Zero if it is not specified. | 3700 | * Zero if it is not specified. |
3701 | */ | 3701 | */ |
3702 | resource_size_t pci_specified_resource_alignment(struct pci_dev *dev) | 3702 | static resource_size_t pci_specified_resource_alignment(struct pci_dev *dev) |
3703 | { | 3703 | { |
3704 | int seg, bus, slot, func, align_order, count; | 3704 | int seg, bus, slot, func, align_order, count; |
3705 | resource_size_t align = 0; | 3705 | resource_size_t align = 0; |
@@ -3812,7 +3812,7 @@ void pci_reassigndev_resource_alignment(struct pci_dev *dev) | |||
3812 | } | 3812 | } |
3813 | } | 3813 | } |
3814 | 3814 | ||
3815 | ssize_t pci_set_resource_alignment_param(const char *buf, size_t count) | 3815 | static ssize_t pci_set_resource_alignment_param(const char *buf, size_t count) |
3816 | { | 3816 | { |
3817 | if (count > RESOURCE_ALIGNMENT_PARAM_SIZE - 1) | 3817 | if (count > RESOURCE_ALIGNMENT_PARAM_SIZE - 1) |
3818 | count = RESOURCE_ALIGNMENT_PARAM_SIZE - 1; | 3818 | count = RESOURCE_ALIGNMENT_PARAM_SIZE - 1; |
@@ -3823,7 +3823,7 @@ ssize_t pci_set_resource_alignment_param(const char *buf, size_t count) | |||
3823 | return count; | 3823 | return count; |
3824 | } | 3824 | } |
3825 | 3825 | ||
3826 | ssize_t pci_get_resource_alignment_param(char *buf, size_t size) | 3826 | static ssize_t pci_get_resource_alignment_param(char *buf, size_t size) |
3827 | { | 3827 | { |
3828 | size_t count; | 3828 | size_t count; |
3829 | spin_lock(&resource_alignment_lock); | 3829 | spin_lock(&resource_alignment_lock); |
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 7346ee68f47d..68678ed76b0d 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h | |||
@@ -8,26 +8,25 @@ | |||
8 | 8 | ||
9 | /* Functions internal to the PCI core code */ | 9 | /* Functions internal to the PCI core code */ |
10 | 10 | ||
11 | extern int pci_create_sysfs_dev_files(struct pci_dev *pdev); | 11 | int pci_create_sysfs_dev_files(struct pci_dev *pdev); |
12 | extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev); | 12 | void pci_remove_sysfs_dev_files(struct pci_dev *pdev); |
13 | #if !defined(CONFIG_DMI) && !defined(CONFIG_ACPI) | 13 | #if !defined(CONFIG_DMI) && !defined(CONFIG_ACPI) |
14 | static inline void pci_create_firmware_label_files(struct pci_dev *pdev) | 14 | static inline void pci_create_firmware_label_files(struct pci_dev *pdev) |
15 | { return; } | 15 | { return; } |
16 | static inline void pci_remove_firmware_label_files(struct pci_dev *pdev) | 16 | static inline void pci_remove_firmware_label_files(struct pci_dev *pdev) |
17 | { return; } | 17 | { return; } |
18 | #else | 18 | #else |
19 | extern void pci_create_firmware_label_files(struct pci_dev *pdev); | 19 | void pci_create_firmware_label_files(struct pci_dev *pdev); |
20 | extern void pci_remove_firmware_label_files(struct pci_dev *pdev); | 20 | void pci_remove_firmware_label_files(struct pci_dev *pdev); |
21 | #endif | 21 | #endif |
22 | extern void pci_cleanup_rom(struct pci_dev *dev); | 22 | void pci_cleanup_rom(struct pci_dev *dev); |
23 | #ifdef HAVE_PCI_MMAP | 23 | #ifdef HAVE_PCI_MMAP |
24 | enum pci_mmap_api { | 24 | enum pci_mmap_api { |
25 | PCI_MMAP_SYSFS, /* mmap on /sys/bus/pci/devices/<BDF>/resource<N> */ | 25 | PCI_MMAP_SYSFS, /* mmap on /sys/bus/pci/devices/<BDF>/resource<N> */ |
26 | PCI_MMAP_PROCFS /* mmap on /proc/bus/pci/<BDF> */ | 26 | PCI_MMAP_PROCFS /* mmap on /proc/bus/pci/<BDF> */ |
27 | }; | 27 | }; |
28 | extern int pci_mmap_fits(struct pci_dev *pdev, int resno, | 28 | int pci_mmap_fits(struct pci_dev *pdev, int resno, struct vm_area_struct *vmai, |
29 | struct vm_area_struct *vmai, | 29 | enum pci_mmap_api mmap_api); |
30 | enum pci_mmap_api mmap_api); | ||
31 | #endif | 30 | #endif |
32 | int pci_probe_reset_function(struct pci_dev *dev); | 31 | int pci_probe_reset_function(struct pci_dev *dev); |
33 | 32 | ||
@@ -60,17 +59,17 @@ struct pci_platform_pm_ops { | |||
60 | int (*run_wake)(struct pci_dev *dev, bool enable); | 59 | int (*run_wake)(struct pci_dev *dev, bool enable); |
61 | }; | 60 | }; |
62 | 61 | ||
63 | extern int pci_set_platform_pm(struct pci_platform_pm_ops *ops); | 62 | int pci_set_platform_pm(struct pci_platform_pm_ops *ops); |
64 | extern void pci_update_current_state(struct pci_dev *dev, pci_power_t state); | 63 | void pci_update_current_state(struct pci_dev *dev, pci_power_t state); |
65 | extern void pci_power_up(struct pci_dev *dev); | 64 | void pci_power_up(struct pci_dev *dev); |
66 | extern void pci_disable_enabled_device(struct pci_dev *dev); | 65 | void pci_disable_enabled_device(struct pci_dev *dev); |
67 | extern int pci_finish_runtime_suspend(struct pci_dev *dev); | 66 | int pci_finish_runtime_suspend(struct pci_dev *dev); |
68 | extern int __pci_pme_wakeup(struct pci_dev *dev, void *ign); | 67 | int __pci_pme_wakeup(struct pci_dev *dev, void *ign); |
69 | extern void pci_wakeup_bus(struct pci_bus *bus); | 68 | void pci_wakeup_bus(struct pci_bus *bus); |
70 | extern void pci_config_pm_runtime_get(struct pci_dev *dev); | 69 | void pci_config_pm_runtime_get(struct pci_dev *dev); |
71 | extern void pci_config_pm_runtime_put(struct pci_dev *dev); | 70 | void pci_config_pm_runtime_put(struct pci_dev *dev); |
72 | extern void pci_pm_init(struct pci_dev *dev); | 71 | void pci_pm_init(struct pci_dev *dev); |
73 | extern void pci_allocate_cap_save_buffers(struct pci_dev *dev); | 72 | void pci_allocate_cap_save_buffers(struct pci_dev *dev); |
74 | void pci_free_cap_save_buffers(struct pci_dev *dev); | 73 | void pci_free_cap_save_buffers(struct pci_dev *dev); |
75 | 74 | ||
76 | static inline void pci_wakeup_event(struct pci_dev *dev) | 75 | static inline void pci_wakeup_event(struct pci_dev *dev) |
@@ -96,7 +95,7 @@ struct pci_vpd { | |||
96 | struct bin_attribute *attr; /* descriptor for sysfs VPD entry */ | 95 | struct bin_attribute *attr; /* descriptor for sysfs VPD entry */ |
97 | }; | 96 | }; |
98 | 97 | ||
99 | extern int pci_vpd_pci22_init(struct pci_dev *dev); | 98 | int pci_vpd_pci22_init(struct pci_dev *dev); |
100 | static inline void pci_vpd_release(struct pci_dev *dev) | 99 | static inline void pci_vpd_release(struct pci_dev *dev) |
101 | { | 100 | { |
102 | if (dev->vpd) | 101 | if (dev->vpd) |
@@ -105,9 +104,9 @@ static inline void pci_vpd_release(struct pci_dev *dev) | |||
105 | 104 | ||
106 | /* PCI /proc functions */ | 105 | /* PCI /proc functions */ |
107 | #ifdef CONFIG_PROC_FS | 106 | #ifdef CONFIG_PROC_FS |
108 | extern int pci_proc_attach_device(struct pci_dev *dev); | 107 | int pci_proc_attach_device(struct pci_dev *dev); |
109 | extern int pci_proc_detach_device(struct pci_dev *dev); | 108 | int pci_proc_detach_device(struct pci_dev *dev); |
110 | extern int pci_proc_detach_bus(struct pci_bus *bus); | 109 | int pci_proc_detach_bus(struct pci_bus *bus); |
111 | #else | 110 | #else |
112 | static inline int pci_proc_attach_device(struct pci_dev *dev) { return 0; } | 111 | static inline int pci_proc_attach_device(struct pci_dev *dev) { return 0; } |
113 | static inline int pci_proc_detach_device(struct pci_dev *dev) { return 0; } | 112 | static inline int pci_proc_detach_device(struct pci_dev *dev) { return 0; } |
@@ -118,8 +117,8 @@ static inline int pci_proc_detach_bus(struct pci_bus *bus) { return 0; } | |||
118 | int pci_hp_add_bridge(struct pci_dev *dev); | 117 | int pci_hp_add_bridge(struct pci_dev *dev); |
119 | 118 | ||
120 | #ifdef HAVE_PCI_LEGACY | 119 | #ifdef HAVE_PCI_LEGACY |
121 | extern void pci_create_legacy_files(struct pci_bus *bus); | 120 | void pci_create_legacy_files(struct pci_bus *bus); |
122 | extern void pci_remove_legacy_files(struct pci_bus *bus); | 121 | void pci_remove_legacy_files(struct pci_bus *bus); |
123 | #else | 122 | #else |
124 | static inline void pci_create_legacy_files(struct pci_bus *bus) { return; } | 123 | static inline void pci_create_legacy_files(struct pci_bus *bus) { return; } |
125 | static inline void pci_remove_legacy_files(struct pci_bus *bus) { return; } | 124 | static inline void pci_remove_legacy_files(struct pci_bus *bus) { return; } |
@@ -134,7 +133,7 @@ extern unsigned int pci_pm_d3_delay; | |||
134 | 133 | ||
135 | #ifdef CONFIG_PCI_MSI | 134 | #ifdef CONFIG_PCI_MSI |
136 | void pci_no_msi(void); | 135 | void pci_no_msi(void); |
137 | extern void pci_msi_init_pci_dev(struct pci_dev *dev); | 136 | void pci_msi_init_pci_dev(struct pci_dev *dev); |
138 | #else | 137 | #else |
139 | static inline void pci_no_msi(void) { } | 138 | static inline void pci_no_msi(void) { } |
140 | static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { } | 139 | static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { } |
@@ -198,12 +197,11 @@ enum pci_bar_type { | |||
198 | 197 | ||
199 | bool pci_bus_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *pl, | 198 | bool pci_bus_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *pl, |
200 | int crs_timeout); | 199 | int crs_timeout); |
201 | extern int pci_setup_device(struct pci_dev *dev); | 200 | int pci_setup_device(struct pci_dev *dev); |
202 | extern int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, | 201 | int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, |
203 | struct resource *res, unsigned int reg); | 202 | struct resource *res, unsigned int reg); |
204 | extern int pci_resource_bar(struct pci_dev *dev, int resno, | 203 | int pci_resource_bar(struct pci_dev *dev, int resno, enum pci_bar_type *type); |
205 | enum pci_bar_type *type); | 204 | void pci_configure_ari(struct pci_dev *dev); |
206 | extern void pci_configure_ari(struct pci_dev *dev); | ||
207 | 205 | ||
208 | /** | 206 | /** |
209 | * pci_ari_enabled - query ARI forwarding status | 207 | * pci_ari_enabled - query ARI forwarding status |
@@ -217,7 +215,7 @@ static inline int pci_ari_enabled(struct pci_bus *bus) | |||
217 | } | 215 | } |
218 | 216 | ||
219 | void pci_reassigndev_resource_alignment(struct pci_dev *dev); | 217 | void pci_reassigndev_resource_alignment(struct pci_dev *dev); |
220 | extern void pci_disable_bridge_window(struct pci_dev *dev); | 218 | void pci_disable_bridge_window(struct pci_dev *dev); |
221 | 219 | ||
222 | /* Single Root I/O Virtualization */ | 220 | /* Single Root I/O Virtualization */ |
223 | struct pci_sriov { | 221 | struct pci_sriov { |
@@ -241,7 +239,7 @@ struct pci_sriov { | |||
241 | }; | 239 | }; |
242 | 240 | ||
243 | #ifdef CONFIG_PCI_ATS | 241 | #ifdef CONFIG_PCI_ATS |
244 | extern void pci_restore_ats_state(struct pci_dev *dev); | 242 | void pci_restore_ats_state(struct pci_dev *dev); |
245 | #else | 243 | #else |
246 | static inline void pci_restore_ats_state(struct pci_dev *dev) | 244 | static inline void pci_restore_ats_state(struct pci_dev *dev) |
247 | { | 245 | { |
@@ -249,14 +247,13 @@ static inline void pci_restore_ats_state(struct pci_dev *dev) | |||
249 | #endif /* CONFIG_PCI_ATS */ | 247 | #endif /* CONFIG_PCI_ATS */ |
250 | 248 | ||
251 | #ifdef CONFIG_PCI_IOV | 249 | #ifdef CONFIG_PCI_IOV |
252 | extern int pci_iov_init(struct pci_dev *dev); | 250 | int pci_iov_init(struct pci_dev *dev); |
253 | extern void pci_iov_release(struct pci_dev *dev); | 251 | void pci_iov_release(struct pci_dev *dev); |
254 | extern int pci_iov_resource_bar(struct pci_dev *dev, int resno, | 252 | int pci_iov_resource_bar(struct pci_dev *dev, int resno, |
255 | enum pci_bar_type *type); | 253 | enum pci_bar_type *type); |
256 | extern resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, | 254 | resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, int resno); |
257 | int resno); | 255 | void pci_restore_iov_state(struct pci_dev *dev); |
258 | extern void pci_restore_iov_state(struct pci_dev *dev); | 256 | int pci_iov_bus_range(struct pci_bus *bus); |
259 | extern int pci_iov_bus_range(struct pci_bus *bus); | ||
260 | 257 | ||
261 | #else | 258 | #else |
262 | static inline int pci_iov_init(struct pci_dev *dev) | 259 | static inline int pci_iov_init(struct pci_dev *dev) |
@@ -282,10 +279,10 @@ static inline int pci_iov_bus_range(struct pci_bus *bus) | |||
282 | 279 | ||
283 | #endif /* CONFIG_PCI_IOV */ | 280 | #endif /* CONFIG_PCI_IOV */ |
284 | 281 | ||
285 | extern unsigned long pci_cardbus_resource_alignment(struct resource *); | 282 | unsigned long pci_cardbus_resource_alignment(struct resource *); |
286 | 283 | ||
287 | static inline resource_size_t pci_resource_alignment(struct pci_dev *dev, | 284 | static inline resource_size_t pci_resource_alignment(struct pci_dev *dev, |
288 | struct resource *res) | 285 | struct resource *res) |
289 | { | 286 | { |
290 | #ifdef CONFIG_PCI_IOV | 287 | #ifdef CONFIG_PCI_IOV |
291 | int resno = res - dev->resource; | 288 | int resno = res - dev->resource; |
@@ -298,7 +295,7 @@ static inline resource_size_t pci_resource_alignment(struct pci_dev *dev, | |||
298 | return resource_alignment(res); | 295 | return resource_alignment(res); |
299 | } | 296 | } |
300 | 297 | ||
301 | extern void pci_enable_acs(struct pci_dev *dev); | 298 | void pci_enable_acs(struct pci_dev *dev); |
302 | 299 | ||
303 | struct pci_dev_reset_methods { | 300 | struct pci_dev_reset_methods { |
304 | u16 vendor; | 301 | u16 vendor; |
@@ -307,7 +304,7 @@ struct pci_dev_reset_methods { | |||
307 | }; | 304 | }; |
308 | 305 | ||
309 | #ifdef CONFIG_PCI_QUIRKS | 306 | #ifdef CONFIG_PCI_QUIRKS |
310 | extern int pci_dev_specific_reset(struct pci_dev *dev, int probe); | 307 | int pci_dev_specific_reset(struct pci_dev *dev, int probe); |
311 | #else | 308 | #else |
312 | static inline int pci_dev_specific_reset(struct pci_dev *dev, int probe) | 309 | static inline int pci_dev_specific_reset(struct pci_dev *dev, int probe) |
313 | { | 310 | { |
diff --git a/drivers/pci/pcie/aer/aer_inject.c b/drivers/pci/pcie/aer/aer_inject.c index 8d4a5e3dbe8e..587e7e853107 100644 --- a/drivers/pci/pcie/aer/aer_inject.c +++ b/drivers/pci/pcie/aer/aer_inject.c | |||
@@ -212,8 +212,8 @@ out: | |||
212 | return ops->read(bus, devfn, where, size, val); | 212 | return ops->read(bus, devfn, where, size, val); |
213 | } | 213 | } |
214 | 214 | ||
215 | int pci_write_aer(struct pci_bus *bus, unsigned int devfn, int where, int size, | 215 | static int pci_write_aer(struct pci_bus *bus, unsigned int devfn, int where, |
216 | u32 val) | 216 | int size, u32 val) |
217 | { | 217 | { |
218 | u32 *sim; | 218 | u32 *sim; |
219 | struct aer_error *err; | 219 | struct aer_error *err; |
diff --git a/drivers/pci/pcie/aer/aerdrv.h b/drivers/pci/pcie/aer/aerdrv.h index 22f840f4dda1..d12c77cd6991 100644 --- a/drivers/pci/pcie/aer/aerdrv.h +++ b/drivers/pci/pcie/aer/aerdrv.h | |||
@@ -110,15 +110,15 @@ static inline pci_ers_result_t merge_result(enum pci_ers_result orig, | |||
110 | } | 110 | } |
111 | 111 | ||
112 | extern struct bus_type pcie_port_bus_type; | 112 | extern struct bus_type pcie_port_bus_type; |
113 | extern void aer_do_secondary_bus_reset(struct pci_dev *dev); | 113 | void aer_do_secondary_bus_reset(struct pci_dev *dev); |
114 | extern int aer_init(struct pcie_device *dev); | 114 | int aer_init(struct pcie_device *dev); |
115 | extern void aer_isr(struct work_struct *work); | 115 | void aer_isr(struct work_struct *work); |
116 | extern void aer_print_error(struct pci_dev *dev, struct aer_err_info *info); | 116 | void aer_print_error(struct pci_dev *dev, struct aer_err_info *info); |
117 | extern void aer_print_port_info(struct pci_dev *dev, struct aer_err_info *info); | 117 | void aer_print_port_info(struct pci_dev *dev, struct aer_err_info *info); |
118 | extern irqreturn_t aer_irq(int irq, void *context); | 118 | irqreturn_t aer_irq(int irq, void *context); |
119 | 119 | ||
120 | #ifdef CONFIG_ACPI_APEI | 120 | #ifdef CONFIG_ACPI_APEI |
121 | extern int pcie_aer_get_firmware_first(struct pci_dev *pci_dev); | 121 | int pcie_aer_get_firmware_first(struct pci_dev *pci_dev); |
122 | #else | 122 | #else |
123 | static inline int pcie_aer_get_firmware_first(struct pci_dev *pci_dev) | 123 | static inline int pcie_aer_get_firmware_first(struct pci_dev *pci_dev) |
124 | { | 124 | { |
diff --git a/drivers/pci/pcie/portdrv.h b/drivers/pci/pcie/portdrv.h index eea2ca2375e6..d2eb80aab569 100644 --- a/drivers/pci/pcie/portdrv.h +++ b/drivers/pci/pcie/portdrv.h | |||
@@ -21,18 +21,18 @@ | |||
21 | #define get_descriptor_id(type, service) (((type - 4) << 4) | service) | 21 | #define get_descriptor_id(type, service) (((type - 4) << 4) | service) |
22 | 22 | ||
23 | extern struct bus_type pcie_port_bus_type; | 23 | extern struct bus_type pcie_port_bus_type; |
24 | extern int pcie_port_device_register(struct pci_dev *dev); | 24 | int pcie_port_device_register(struct pci_dev *dev); |
25 | #ifdef CONFIG_PM | 25 | #ifdef CONFIG_PM |
26 | extern int pcie_port_device_suspend(struct device *dev); | 26 | int pcie_port_device_suspend(struct device *dev); |
27 | extern int pcie_port_device_resume(struct device *dev); | 27 | int pcie_port_device_resume(struct device *dev); |
28 | #endif | 28 | #endif |
29 | extern void pcie_port_device_remove(struct pci_dev *dev); | 29 | void pcie_port_device_remove(struct pci_dev *dev); |
30 | extern int __must_check pcie_port_bus_register(void); | 30 | int __must_check pcie_port_bus_register(void); |
31 | extern void pcie_port_bus_unregister(void); | 31 | void pcie_port_bus_unregister(void); |
32 | 32 | ||
33 | struct pci_dev; | 33 | struct pci_dev; |
34 | 34 | ||
35 | extern void pcie_clear_root_pme_status(struct pci_dev *dev); | 35 | void pcie_clear_root_pme_status(struct pci_dev *dev); |
36 | 36 | ||
37 | #ifdef CONFIG_HOTPLUG_PCI_PCIE | 37 | #ifdef CONFIG_HOTPLUG_PCI_PCIE |
38 | extern bool pciehp_msi_disabled; | 38 | extern bool pciehp_msi_disabled; |
@@ -59,7 +59,7 @@ static inline bool pcie_pme_no_msi(void) | |||
59 | return pcie_pme_msi_disabled; | 59 | return pcie_pme_msi_disabled; |
60 | } | 60 | } |
61 | 61 | ||
62 | extern void pcie_pme_interrupt_enable(struct pci_dev *dev, bool enable); | 62 | void pcie_pme_interrupt_enable(struct pci_dev *dev, bool enable); |
63 | #else /* !CONFIG_PCIE_PME */ | 63 | #else /* !CONFIG_PCIE_PME */ |
64 | static inline void pcie_pme_disable_msi(void) {} | 64 | static inline void pcie_pme_disable_msi(void) {} |
65 | static inline bool pcie_pme_no_msi(void) { return false; } | 65 | static inline bool pcie_pme_no_msi(void) { return false; } |
@@ -67,7 +67,7 @@ static inline void pcie_pme_interrupt_enable(struct pci_dev *dev, bool en) {} | |||
67 | #endif /* !CONFIG_PCIE_PME */ | 67 | #endif /* !CONFIG_PCIE_PME */ |
68 | 68 | ||
69 | #ifdef CONFIG_ACPI | 69 | #ifdef CONFIG_ACPI |
70 | extern int pcie_port_acpi_setup(struct pci_dev *port, int *mask); | 70 | int pcie_port_acpi_setup(struct pci_dev *port, int *mask); |
71 | 71 | ||
72 | static inline int pcie_port_platform_notify(struct pci_dev *port, int *mask) | 72 | static inline int pcie_port_platform_notify(struct pci_dev *port, int *mask) |
73 | { | 73 | { |
diff --git a/drivers/pci/pcie/portdrv_acpi.c b/drivers/pci/pcie/portdrv_acpi.c index a86b56e5f2f2..b4d2894ee3fc 100644 --- a/drivers/pci/pcie/portdrv_acpi.c +++ b/drivers/pci/pcie/portdrv_acpi.c | |||
@@ -17,6 +17,7 @@ | |||
17 | 17 | ||
18 | #include "aer/aerdrv.h" | 18 | #include "aer/aerdrv.h" |
19 | #include "../pci.h" | 19 | #include "../pci.h" |
20 | #include "portdrv.h" | ||
20 | 21 | ||
21 | /** | 22 | /** |
22 | * pcie_port_acpi_setup - Request the BIOS to release control of PCIe services. | 23 | * pcie_port_acpi_setup - Request the BIOS to release control of PCIe services. |
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c index 08c243ab034e..0efba0539cc9 100644 --- a/drivers/pci/pcie/portdrv_pci.c +++ b/drivers/pci/pcie/portdrv_pci.c | |||
@@ -272,11 +272,9 @@ static pci_ers_result_t pcie_portdrv_error_detected(struct pci_dev *dev, | |||
272 | enum pci_channel_state error) | 272 | enum pci_channel_state error) |
273 | { | 273 | { |
274 | struct aer_broadcast_data data = {error, PCI_ERS_RESULT_CAN_RECOVER}; | 274 | struct aer_broadcast_data data = {error, PCI_ERS_RESULT_CAN_RECOVER}; |
275 | int ret; | ||
276 | |||
277 | /* can not fail */ | ||
278 | ret = device_for_each_child(&dev->dev, &data, error_detected_iter); | ||
279 | 275 | ||
276 | /* get true return value from &data */ | ||
277 | device_for_each_child(&dev->dev, &data, error_detected_iter); | ||
280 | return data.result; | 278 | return data.result; |
281 | } | 279 | } |
282 | 280 | ||
@@ -308,10 +306,9 @@ static int mmio_enabled_iter(struct device *device, void *data) | |||
308 | static pci_ers_result_t pcie_portdrv_mmio_enabled(struct pci_dev *dev) | 306 | static pci_ers_result_t pcie_portdrv_mmio_enabled(struct pci_dev *dev) |
309 | { | 307 | { |
310 | pci_ers_result_t status = PCI_ERS_RESULT_RECOVERED; | 308 | pci_ers_result_t status = PCI_ERS_RESULT_RECOVERED; |
311 | int retval; | ||
312 | 309 | ||
313 | /* get true return value from &status */ | 310 | /* get true return value from &status */ |
314 | retval = device_for_each_child(&dev->dev, &status, mmio_enabled_iter); | 311 | device_for_each_child(&dev->dev, &status, mmio_enabled_iter); |
315 | return status; | 312 | return status; |
316 | } | 313 | } |
317 | 314 | ||
@@ -343,7 +340,6 @@ static int slot_reset_iter(struct device *device, void *data) | |||
343 | static pci_ers_result_t pcie_portdrv_slot_reset(struct pci_dev *dev) | 340 | static pci_ers_result_t pcie_portdrv_slot_reset(struct pci_dev *dev) |
344 | { | 341 | { |
345 | pci_ers_result_t status = PCI_ERS_RESULT_RECOVERED; | 342 | pci_ers_result_t status = PCI_ERS_RESULT_RECOVERED; |
346 | int retval; | ||
347 | 343 | ||
348 | /* If fatal, restore cfg space for possible link reset at upstream */ | 344 | /* If fatal, restore cfg space for possible link reset at upstream */ |
349 | if (dev->error_state == pci_channel_io_frozen) { | 345 | if (dev->error_state == pci_channel_io_frozen) { |
@@ -354,8 +350,7 @@ static pci_ers_result_t pcie_portdrv_slot_reset(struct pci_dev *dev) | |||
354 | } | 350 | } |
355 | 351 | ||
356 | /* get true return value from &status */ | 352 | /* get true return value from &status */ |
357 | retval = device_for_each_child(&dev->dev, &status, slot_reset_iter); | 353 | device_for_each_child(&dev->dev, &status, slot_reset_iter); |
358 | |||
359 | return status; | 354 | return status; |
360 | } | 355 | } |
361 | 356 | ||
@@ -381,9 +376,7 @@ static int resume_iter(struct device *device, void *data) | |||
381 | 376 | ||
382 | static void pcie_portdrv_err_resume(struct pci_dev *dev) | 377 | static void pcie_portdrv_err_resume(struct pci_dev *dev) |
383 | { | 378 | { |
384 | int retval; | 379 | device_for_each_child(&dev->dev, NULL, resume_iter); |
385 | /* nothing to do with error value, if it ever happens */ | ||
386 | retval = device_for_each_child(&dev->dev, NULL, resume_iter); | ||
387 | } | 380 | } |
388 | 381 | ||
389 | /* | 382 | /* |
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 7e8739e25b9e..16abaaa1f83c 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c | |||
@@ -1044,7 +1044,7 @@ handle_done: | |||
1044 | ; | 1044 | ; |
1045 | } | 1045 | } |
1046 | 1046 | ||
1047 | void __ref __pci_bus_size_bridges(struct pci_bus *bus, | 1047 | static void __ref __pci_bus_size_bridges(struct pci_bus *bus, |
1048 | struct list_head *realloc_head) | 1048 | struct list_head *realloc_head) |
1049 | { | 1049 | { |
1050 | struct pci_dev *dev; | 1050 | struct pci_dev *dev; |
@@ -1545,6 +1545,8 @@ again: | |||
1545 | 1545 | ||
1546 | enable_all: | 1546 | enable_all: |
1547 | retval = pci_reenable_device(bridge); | 1547 | retval = pci_reenable_device(bridge); |
1548 | if (retval) | ||
1549 | dev_err(&bridge->dev, "Error reenabling bridge (%d)\n", retval); | ||
1548 | pci_set_master(bridge); | 1550 | pci_set_master(bridge); |
1549 | pci_enable_bridges(parent); | 1551 | pci_enable_bridges(parent); |
1550 | } | 1552 | } |
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 81b88bda7930..07f2eddc09ce 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c | |||
@@ -261,7 +261,6 @@ int pci_assign_resource(struct pci_dev *dev, int resno) | |||
261 | { | 261 | { |
262 | struct resource *res = dev->resource + resno; | 262 | struct resource *res = dev->resource + resno; |
263 | resource_size_t align, size; | 263 | resource_size_t align, size; |
264 | struct pci_bus *bus; | ||
265 | int ret; | 264 | int ret; |
266 | 265 | ||
267 | align = pci_resource_alignment(dev, res); | 266 | align = pci_resource_alignment(dev, res); |
@@ -271,7 +270,6 @@ int pci_assign_resource(struct pci_dev *dev, int resno) | |||
271 | return -EINVAL; | 270 | return -EINVAL; |
272 | } | 271 | } |
273 | 272 | ||
274 | bus = dev->bus; | ||
275 | size = resource_size(res); | 273 | size = resource_size(res); |
276 | ret = _pci_assign_resource(dev, resno, size, align); | 274 | ret = _pci_assign_resource(dev, resno, size, align); |
277 | 275 | ||
diff --git a/drivers/pci/slot.c b/drivers/pci/slot.c index ac6412fb8d6f..c1e9284a677b 100644 --- a/drivers/pci/slot.c +++ b/drivers/pci/slot.c | |||
@@ -377,14 +377,17 @@ void pci_hp_create_module_link(struct pci_slot *pci_slot) | |||
377 | { | 377 | { |
378 | struct hotplug_slot *slot = pci_slot->hotplug; | 378 | struct hotplug_slot *slot = pci_slot->hotplug; |
379 | struct kobject *kobj = NULL; | 379 | struct kobject *kobj = NULL; |
380 | int no_warn; | 380 | int ret; |
381 | 381 | ||
382 | if (!slot || !slot->ops) | 382 | if (!slot || !slot->ops) |
383 | return; | 383 | return; |
384 | kobj = kset_find_obj(module_kset, slot->ops->mod_name); | 384 | kobj = kset_find_obj(module_kset, slot->ops->mod_name); |
385 | if (!kobj) | 385 | if (!kobj) |
386 | return; | 386 | return; |
387 | no_warn = sysfs_create_link(&pci_slot->kobj, kobj, "module"); | 387 | ret = sysfs_create_link(&pci_slot->kobj, kobj, "module"); |
388 | if (ret) | ||
389 | dev_err(&pci_slot->bus->dev, "Error creating sysfs link (%d)\n", | ||
390 | ret); | ||
388 | kobject_put(kobj); | 391 | kobject_put(kobj); |
389 | } | 392 | } |
390 | EXPORT_SYMBOL_GPL(pci_hp_create_module_link); | 393 | EXPORT_SYMBOL_GPL(pci_hp_create_module_link); |