diff options
Diffstat (limited to 'drivers/pci/hotplug')
33 files changed, 303 insertions, 355 deletions
diff --git a/drivers/pci/hotplug/acpiphp_core.c b/drivers/pci/hotplug/acpiphp_core.c index 728c31f4c2c5..e291efcd02a2 100644 --- a/drivers/pci/hotplug/acpiphp_core.c +++ b/drivers/pci/hotplug/acpiphp_core.c | |||
@@ -63,10 +63,6 @@ MODULE_LICENSE("GPL"); | |||
63 | MODULE_PARM_DESC(disable, "disable acpiphp driver"); | 63 | MODULE_PARM_DESC(disable, "disable acpiphp driver"); |
64 | module_param_named(disable, acpiphp_disabled, bool, 0444); | 64 | module_param_named(disable, acpiphp_disabled, bool, 0444); |
65 | 65 | ||
66 | /* export the attention callback registration methods */ | ||
67 | EXPORT_SYMBOL_GPL(acpiphp_register_attention); | ||
68 | EXPORT_SYMBOL_GPL(acpiphp_unregister_attention); | ||
69 | |||
70 | static int enable_slot (struct hotplug_slot *slot); | 66 | static int enable_slot (struct hotplug_slot *slot); |
71 | static int disable_slot (struct hotplug_slot *slot); | 67 | static int disable_slot (struct hotplug_slot *slot); |
72 | static int set_attention_status (struct hotplug_slot *slot, u8 value); | 68 | static int set_attention_status (struct hotplug_slot *slot, u8 value); |
@@ -104,6 +100,7 @@ int acpiphp_register_attention(struct acpiphp_attention_info *info) | |||
104 | } | 100 | } |
105 | return retval; | 101 | return retval; |
106 | } | 102 | } |
103 | EXPORT_SYMBOL_GPL(acpiphp_register_attention); | ||
107 | 104 | ||
108 | 105 | ||
109 | /** | 106 | /** |
@@ -124,6 +121,7 @@ int acpiphp_unregister_attention(struct acpiphp_attention_info *info) | |||
124 | } | 121 | } |
125 | return retval; | 122 | return retval; |
126 | } | 123 | } |
124 | EXPORT_SYMBOL_GPL(acpiphp_unregister_attention); | ||
127 | 125 | ||
128 | 126 | ||
129 | /** | 127 | /** |
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index 75e178330215..772d8766338a 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c | |||
@@ -351,11 +351,9 @@ static acpi_status acpiphp_add_context(acpi_handle handle, u32 lvl, void *data, | |||
351 | slot->slot = NULL; | 351 | slot->slot = NULL; |
352 | bridge->nr_slots--; | 352 | bridge->nr_slots--; |
353 | if (retval == -EBUSY) | 353 | if (retval == -EBUSY) |
354 | pr_warn("Slot %llu already registered by another " | 354 | pr_warn("Slot %llu already registered by another hotplug driver\n", sun); |
355 | "hotplug driver\n", sun); | ||
356 | else | 355 | else |
357 | pr_warn("acpiphp_register_hotplug_slot failed " | 356 | pr_warn("acpiphp_register_hotplug_slot failed (err code = 0x%x)\n", retval); |
358 | "(err code = 0x%x)\n", retval); | ||
359 | } | 357 | } |
360 | /* Even if the slot registration fails, we can still use it. */ | 358 | /* Even if the slot registration fails, we can still use it. */ |
361 | } | 359 | } |
diff --git a/drivers/pci/hotplug/cpci_hotplug.h b/drivers/pci/hotplug/cpci_hotplug.h index 1356211431d0..6a0ddf757349 100644 --- a/drivers/pci/hotplug/cpci_hotplug.h +++ b/drivers/pci/hotplug/cpci_hotplug.h | |||
@@ -56,9 +56,9 @@ struct cpci_hp_controller_ops { | |||
56 | int (*enable_irq) (void); | 56 | int (*enable_irq) (void); |
57 | int (*disable_irq) (void); | 57 | int (*disable_irq) (void); |
58 | int (*check_irq) (void *dev_id); | 58 | int (*check_irq) (void *dev_id); |
59 | int (*hardware_test) (struct slot* slot, u32 value); | 59 | int (*hardware_test) (struct slot *slot, u32 value); |
60 | u8 (*get_power) (struct slot* slot); | 60 | u8 (*get_power) (struct slot *slot); |
61 | int (*set_power) (struct slot* slot, int value); | 61 | int (*set_power) (struct slot *slot, int value); |
62 | }; | 62 | }; |
63 | 63 | ||
64 | struct cpci_hp_controller { | 64 | struct cpci_hp_controller { |
@@ -89,13 +89,13 @@ int cpci_hp_stop(void); | |||
89 | u8 cpci_get_attention_status(struct slot *slot); | 89 | u8 cpci_get_attention_status(struct slot *slot); |
90 | u8 cpci_get_latch_status(struct slot *slot); | 90 | u8 cpci_get_latch_status(struct slot *slot); |
91 | u8 cpci_get_adapter_status(struct slot *slot); | 91 | u8 cpci_get_adapter_status(struct slot *slot); |
92 | u16 cpci_get_hs_csr(struct slot * slot); | 92 | u16 cpci_get_hs_csr(struct slot *slot); |
93 | int cpci_set_attention_status(struct slot *slot, int status); | 93 | int cpci_set_attention_status(struct slot *slot, int status); |
94 | int cpci_check_and_clear_ins(struct slot * slot); | 94 | int cpci_check_and_clear_ins(struct slot *slot); |
95 | int cpci_check_ext(struct slot * slot); | 95 | int cpci_check_ext(struct slot *slot); |
96 | int cpci_clear_ext(struct slot * slot); | 96 | int cpci_clear_ext(struct slot *slot); |
97 | int cpci_led_on(struct slot * slot); | 97 | int cpci_led_on(struct slot *slot); |
98 | int cpci_led_off(struct slot * slot); | 98 | int cpci_led_off(struct slot *slot); |
99 | int cpci_configure_slot(struct slot *slot); | 99 | int cpci_configure_slot(struct slot *slot); |
100 | int cpci_unconfigure_slot(struct slot *slot); | 100 | int cpci_unconfigure_slot(struct slot *slot); |
101 | 101 | ||
diff --git a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c index 00c81a3cefc9..e09cf7827d68 100644 --- a/drivers/pci/hotplug/cpci_hotplug_core.c +++ b/drivers/pci/hotplug/cpci_hotplug_core.c | |||
@@ -65,10 +65,10 @@ static int thread_finished; | |||
65 | static int enable_slot(struct hotplug_slot *slot); | 65 | static int enable_slot(struct hotplug_slot *slot); |
66 | static int disable_slot(struct hotplug_slot *slot); | 66 | static int disable_slot(struct hotplug_slot *slot); |
67 | static int set_attention_status(struct hotplug_slot *slot, u8 value); | 67 | static int set_attention_status(struct hotplug_slot *slot, u8 value); |
68 | static int get_power_status(struct hotplug_slot *slot, u8 * value); | 68 | static int get_power_status(struct hotplug_slot *slot, u8 *value); |
69 | static int get_attention_status(struct hotplug_slot *slot, u8 * value); | 69 | static int get_attention_status(struct hotplug_slot *slot, u8 *value); |
70 | static int get_adapter_status(struct hotplug_slot *slot, u8 * value); | 70 | static int get_adapter_status(struct hotplug_slot *slot, u8 *value); |
71 | static int get_latch_status(struct hotplug_slot *slot, u8 * value); | 71 | static int get_latch_status(struct hotplug_slot *slot, u8 *value); |
72 | 72 | ||
73 | static struct hotplug_slot_ops cpci_hotplug_slot_ops = { | 73 | static struct hotplug_slot_ops cpci_hotplug_slot_ops = { |
74 | .enable_slot = enable_slot, | 74 | .enable_slot = enable_slot, |
@@ -168,7 +168,7 @@ cpci_get_power_status(struct slot *slot) | |||
168 | } | 168 | } |
169 | 169 | ||
170 | static int | 170 | static int |
171 | get_power_status(struct hotplug_slot *hotplug_slot, u8 * value) | 171 | get_power_status(struct hotplug_slot *hotplug_slot, u8 *value) |
172 | { | 172 | { |
173 | struct slot *slot = hotplug_slot->private; | 173 | struct slot *slot = hotplug_slot->private; |
174 | 174 | ||
@@ -177,7 +177,7 @@ get_power_status(struct hotplug_slot *hotplug_slot, u8 * value) | |||
177 | } | 177 | } |
178 | 178 | ||
179 | static int | 179 | static int |
180 | get_attention_status(struct hotplug_slot *hotplug_slot, u8 * value) | 180 | get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value) |
181 | { | 181 | { |
182 | struct slot *slot = hotplug_slot->private; | 182 | struct slot *slot = hotplug_slot->private; |
183 | 183 | ||
@@ -192,14 +192,14 @@ set_attention_status(struct hotplug_slot *hotplug_slot, u8 status) | |||
192 | } | 192 | } |
193 | 193 | ||
194 | static int | 194 | static int |
195 | get_adapter_status(struct hotplug_slot *hotplug_slot, u8 * value) | 195 | get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value) |
196 | { | 196 | { |
197 | *value = hotplug_slot->info->adapter_status; | 197 | *value = hotplug_slot->info->adapter_status; |
198 | return 0; | 198 | return 0; |
199 | } | 199 | } |
200 | 200 | ||
201 | static int | 201 | static int |
202 | get_latch_status(struct hotplug_slot *hotplug_slot, u8 * value) | 202 | get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value) |
203 | { | 203 | { |
204 | *value = hotplug_slot->info->latch_status; | 204 | *value = hotplug_slot->info->latch_status; |
205 | return 0; | 205 | return 0; |
@@ -299,6 +299,7 @@ error_slot: | |||
299 | error: | 299 | error: |
300 | return status; | 300 | return status; |
301 | } | 301 | } |
302 | EXPORT_SYMBOL_GPL(cpci_hp_register_bus); | ||
302 | 303 | ||
303 | int | 304 | int |
304 | cpci_hp_unregister_bus(struct pci_bus *bus) | 305 | cpci_hp_unregister_bus(struct pci_bus *bus) |
@@ -329,6 +330,7 @@ cpci_hp_unregister_bus(struct pci_bus *bus) | |||
329 | up_write(&list_rwsem); | 330 | up_write(&list_rwsem); |
330 | return status; | 331 | return status; |
331 | } | 332 | } |
333 | EXPORT_SYMBOL_GPL(cpci_hp_unregister_bus); | ||
332 | 334 | ||
333 | /* This is the interrupt mode interrupt handler */ | 335 | /* This is the interrupt mode interrupt handler */ |
334 | static irqreturn_t | 336 | static irqreturn_t |
@@ -360,7 +362,7 @@ static int | |||
360 | init_slots(int clear_ins) | 362 | init_slots(int clear_ins) |
361 | { | 363 | { |
362 | struct slot *slot; | 364 | struct slot *slot; |
363 | struct pci_dev* dev; | 365 | struct pci_dev *dev; |
364 | 366 | ||
365 | dbg("%s - enter", __func__); | 367 | dbg("%s - enter", __func__); |
366 | down_read(&list_rwsem); | 368 | down_read(&list_rwsem); |
@@ -614,6 +616,7 @@ cpci_hp_register_controller(struct cpci_hp_controller *new_controller) | |||
614 | controller = new_controller; | 616 | controller = new_controller; |
615 | return status; | 617 | return status; |
616 | } | 618 | } |
619 | EXPORT_SYMBOL_GPL(cpci_hp_register_controller); | ||
617 | 620 | ||
618 | static void | 621 | static void |
619 | cleanup_slots(void) | 622 | cleanup_slots(void) |
@@ -653,6 +656,7 @@ cpci_hp_unregister_controller(struct cpci_hp_controller *old_controller) | |||
653 | status = -ENODEV; | 656 | status = -ENODEV; |
654 | return status; | 657 | return status; |
655 | } | 658 | } |
659 | EXPORT_SYMBOL_GPL(cpci_hp_unregister_controller); | ||
656 | 660 | ||
657 | int | 661 | int |
658 | cpci_hp_start(void) | 662 | cpci_hp_start(void) |
@@ -690,6 +694,7 @@ cpci_hp_start(void) | |||
690 | dbg("%s - exit", __func__); | 694 | dbg("%s - exit", __func__); |
691 | return 0; | 695 | return 0; |
692 | } | 696 | } |
697 | EXPORT_SYMBOL_GPL(cpci_hp_start); | ||
693 | 698 | ||
694 | int | 699 | int |
695 | cpci_hp_stop(void) | 700 | cpci_hp_stop(void) |
@@ -704,6 +709,7 @@ cpci_hp_stop(void) | |||
704 | cpci_stop_thread(); | 709 | cpci_stop_thread(); |
705 | return 0; | 710 | return 0; |
706 | } | 711 | } |
712 | EXPORT_SYMBOL_GPL(cpci_hp_stop); | ||
707 | 713 | ||
708 | int __init | 714 | int __init |
709 | cpci_hotplug_init(int debug) | 715 | cpci_hotplug_init(int debug) |
@@ -721,10 +727,3 @@ cpci_hotplug_exit(void) | |||
721 | cpci_hp_stop(); | 727 | cpci_hp_stop(); |
722 | cpci_hp_unregister_controller(controller); | 728 | cpci_hp_unregister_controller(controller); |
723 | } | 729 | } |
724 | |||
725 | EXPORT_SYMBOL_GPL(cpci_hp_register_controller); | ||
726 | EXPORT_SYMBOL_GPL(cpci_hp_unregister_controller); | ||
727 | EXPORT_SYMBOL_GPL(cpci_hp_register_bus); | ||
728 | EXPORT_SYMBOL_GPL(cpci_hp_unregister_bus); | ||
729 | EXPORT_SYMBOL_GPL(cpci_hp_start); | ||
730 | EXPORT_SYMBOL_GPL(cpci_hp_stop); | ||
diff --git a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c index f6ef64c2ccb5..7d48ecae6695 100644 --- a/drivers/pci/hotplug/cpci_hotplug_pci.c +++ b/drivers/pci/hotplug/cpci_hotplug_pci.c | |||
@@ -46,7 +46,7 @@ extern int cpci_debug; | |||
46 | #define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n", MY_NAME , ## arg) | 46 | #define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n", MY_NAME , ## arg) |
47 | 47 | ||
48 | 48 | ||
49 | u8 cpci_get_attention_status(struct slot* slot) | 49 | u8 cpci_get_attention_status(struct slot *slot) |
50 | { | 50 | { |
51 | int hs_cap; | 51 | int hs_cap; |
52 | u16 hs_csr; | 52 | u16 hs_csr; |
@@ -66,7 +66,7 @@ u8 cpci_get_attention_status(struct slot* slot) | |||
66 | return hs_csr & 0x0008 ? 1 : 0; | 66 | return hs_csr & 0x0008 ? 1 : 0; |
67 | } | 67 | } |
68 | 68 | ||
69 | int cpci_set_attention_status(struct slot* slot, int status) | 69 | int cpci_set_attention_status(struct slot *slot, int status) |
70 | { | 70 | { |
71 | int hs_cap; | 71 | int hs_cap; |
72 | u16 hs_csr; | 72 | u16 hs_csr; |
@@ -93,7 +93,7 @@ int cpci_set_attention_status(struct slot* slot, int status) | |||
93 | return 1; | 93 | return 1; |
94 | } | 94 | } |
95 | 95 | ||
96 | u16 cpci_get_hs_csr(struct slot* slot) | 96 | u16 cpci_get_hs_csr(struct slot *slot) |
97 | { | 97 | { |
98 | int hs_cap; | 98 | int hs_cap; |
99 | u16 hs_csr; | 99 | u16 hs_csr; |
@@ -111,7 +111,7 @@ u16 cpci_get_hs_csr(struct slot* slot) | |||
111 | return hs_csr; | 111 | return hs_csr; |
112 | } | 112 | } |
113 | 113 | ||
114 | int cpci_check_and_clear_ins(struct slot* slot) | 114 | int cpci_check_and_clear_ins(struct slot *slot) |
115 | { | 115 | { |
116 | int hs_cap; | 116 | int hs_cap; |
117 | u16 hs_csr; | 117 | u16 hs_csr; |
@@ -140,7 +140,7 @@ int cpci_check_and_clear_ins(struct slot* slot) | |||
140 | return ins; | 140 | return ins; |
141 | } | 141 | } |
142 | 142 | ||
143 | int cpci_check_ext(struct slot* slot) | 143 | int cpci_check_ext(struct slot *slot) |
144 | { | 144 | { |
145 | int hs_cap; | 145 | int hs_cap; |
146 | u16 hs_csr; | 146 | u16 hs_csr; |
@@ -161,7 +161,7 @@ int cpci_check_ext(struct slot* slot) | |||
161 | return ext; | 161 | return ext; |
162 | } | 162 | } |
163 | 163 | ||
164 | int cpci_clear_ext(struct slot* slot) | 164 | int cpci_clear_ext(struct slot *slot) |
165 | { | 165 | { |
166 | int hs_cap; | 166 | int hs_cap; |
167 | u16 hs_csr; | 167 | u16 hs_csr; |
@@ -187,7 +187,7 @@ int cpci_clear_ext(struct slot* slot) | |||
187 | return 0; | 187 | return 0; |
188 | } | 188 | } |
189 | 189 | ||
190 | int cpci_led_on(struct slot* slot) | 190 | int cpci_led_on(struct slot *slot) |
191 | { | 191 | { |
192 | int hs_cap; | 192 | int hs_cap; |
193 | u16 hs_csr; | 193 | u16 hs_csr; |
@@ -216,7 +216,7 @@ int cpci_led_on(struct slot* slot) | |||
216 | return 0; | 216 | return 0; |
217 | } | 217 | } |
218 | 218 | ||
219 | int cpci_led_off(struct slot* slot) | 219 | int cpci_led_off(struct slot *slot) |
220 | { | 220 | { |
221 | int hs_cap; | 221 | int hs_cap; |
222 | u16 hs_csr; | 222 | u16 hs_csr; |
@@ -303,7 +303,7 @@ int cpci_configure_slot(struct slot *slot) | |||
303 | return ret; | 303 | return ret; |
304 | } | 304 | } |
305 | 305 | ||
306 | int cpci_unconfigure_slot(struct slot* slot) | 306 | int cpci_unconfigure_slot(struct slot *slot) |
307 | { | 307 | { |
308 | struct pci_dev *dev, *temp; | 308 | struct pci_dev *dev, *temp; |
309 | 309 | ||
diff --git a/drivers/pci/hotplug/cpcihp_generic.c b/drivers/pci/hotplug/cpcihp_generic.c index 7536eef620b0..04fcd7811400 100644 --- a/drivers/pci/hotplug/cpcihp_generic.c +++ b/drivers/pci/hotplug/cpcihp_generic.c | |||
@@ -78,8 +78,8 @@ static struct cpci_hp_controller generic_hpc; | |||
78 | 78 | ||
79 | static int __init validate_parameters(void) | 79 | static int __init validate_parameters(void) |
80 | { | 80 | { |
81 | char* str; | 81 | char *str; |
82 | char* p; | 82 | char *p; |
83 | unsigned long tmp; | 83 | unsigned long tmp; |
84 | 84 | ||
85 | if(!bridge) { | 85 | if(!bridge) { |
@@ -142,8 +142,8 @@ static int query_enum(void) | |||
142 | static int __init cpcihp_generic_init(void) | 142 | static int __init cpcihp_generic_init(void) |
143 | { | 143 | { |
144 | int status; | 144 | int status; |
145 | struct resource* r; | 145 | struct resource *r; |
146 | struct pci_dev* dev; | 146 | struct pci_dev *dev; |
147 | 147 | ||
148 | info(DRIVER_DESC " version: " DRIVER_VERSION); | 148 | info(DRIVER_DESC " version: " DRIVER_VERSION); |
149 | status = validate_parameters(); | 149 | status = validate_parameters(); |
diff --git a/drivers/pci/hotplug/cpcihp_zt5550.c b/drivers/pci/hotplug/cpcihp_zt5550.c index e8c4a7ccf578..6757b3ef7e10 100644 --- a/drivers/pci/hotplug/cpcihp_zt5550.c +++ b/drivers/pci/hotplug/cpcihp_zt5550.c | |||
@@ -295,7 +295,7 @@ static struct pci_driver zt5550_hc_driver = { | |||
295 | 295 | ||
296 | static int __init zt5550_init(void) | 296 | static int __init zt5550_init(void) |
297 | { | 297 | { |
298 | struct resource* r; | 298 | struct resource *r; |
299 | int rc; | 299 | int rc; |
300 | 300 | ||
301 | info(DRIVER_DESC " version: " DRIVER_VERSION); | 301 | info(DRIVER_DESC " version: " DRIVER_VERSION); |
diff --git a/drivers/pci/hotplug/cpqphp.h b/drivers/pci/hotplug/cpqphp.h index 516b87738b6e..0450f405807d 100644 --- a/drivers/pci/hotplug/cpqphp.h +++ b/drivers/pci/hotplug/cpqphp.h | |||
@@ -255,7 +255,7 @@ struct pci_func { | |||
255 | struct pci_resource *io_head; | 255 | struct pci_resource *io_head; |
256 | struct pci_resource *bus_head; | 256 | struct pci_resource *bus_head; |
257 | struct timer_list *p_task_event; | 257 | struct timer_list *p_task_event; |
258 | struct pci_dev* pci_dev; | 258 | struct pci_dev *pci_dev; |
259 | }; | 259 | }; |
260 | 260 | ||
261 | struct slot { | 261 | struct slot { |
@@ -278,7 +278,7 @@ struct slot { | |||
278 | }; | 278 | }; |
279 | 279 | ||
280 | struct pci_resource { | 280 | struct pci_resource { |
281 | struct pci_resource * next; | 281 | struct pci_resource *next; |
282 | u32 base; | 282 | u32 base; |
283 | u32 length; | 283 | u32 length; |
284 | }; | 284 | }; |
diff --git a/drivers/pci/hotplug/cpqphp_core.c b/drivers/pci/hotplug/cpqphp_core.c index 037e2612c5bd..4aaee746df88 100644 --- a/drivers/pci/hotplug/cpqphp_core.c +++ b/drivers/pci/hotplug/cpqphp_core.c | |||
@@ -94,7 +94,7 @@ static inline int is_slot66mhz(struct slot *slot) | |||
94 | * | 94 | * |
95 | * Returns pointer to the head of the SMBIOS tables (or %NULL). | 95 | * Returns pointer to the head of the SMBIOS tables (or %NULL). |
96 | */ | 96 | */ |
97 | static void __iomem * detect_SMBIOS_pointer(void __iomem *begin, void __iomem *end) | 97 | static void __iomem *detect_SMBIOS_pointer(void __iomem *begin, void __iomem *end) |
98 | { | 98 | { |
99 | void __iomem *fp; | 99 | void __iomem *fp; |
100 | void __iomem *endp; | 100 | void __iomem *endp; |
@@ -131,7 +131,7 @@ static void __iomem * detect_SMBIOS_pointer(void __iomem *begin, void __iomem *e | |||
131 | * | 131 | * |
132 | * For unexpected switch opens | 132 | * For unexpected switch opens |
133 | */ | 133 | */ |
134 | static int init_SERR(struct controller * ctrl) | 134 | static int init_SERR(struct controller *ctrl) |
135 | { | 135 | { |
136 | u32 tempdword; | 136 | u32 tempdword; |
137 | u32 number_of_slots; | 137 | u32 number_of_slots; |
@@ -291,7 +291,7 @@ static void release_slot(struct hotplug_slot *hotplug_slot) | |||
291 | kfree(slot); | 291 | kfree(slot); |
292 | } | 292 | } |
293 | 293 | ||
294 | static int ctrl_slot_cleanup (struct controller * ctrl) | 294 | static int ctrl_slot_cleanup (struct controller *ctrl) |
295 | { | 295 | { |
296 | struct slot *old_slot, *next_slot; | 296 | struct slot *old_slot, *next_slot; |
297 | 297 | ||
@@ -706,8 +706,7 @@ static int ctrl_slot_setup(struct controller *ctrl, | |||
706 | hotplug_slot_info->adapter_status = | 706 | hotplug_slot_info->adapter_status = |
707 | get_presence_status(ctrl, slot); | 707 | get_presence_status(ctrl, slot); |
708 | 708 | ||
709 | dbg("registering bus %d, dev %d, number %d, " | 709 | dbg("registering bus %d, dev %d, number %d, ctrl->slot_device_offset %d, slot %d\n", |
710 | "ctrl->slot_device_offset %d, slot %d\n", | ||
711 | slot->bus, slot->device, | 710 | slot->bus, slot->device, |
712 | slot->number, ctrl->slot_device_offset, | 711 | slot->number, ctrl->slot_device_offset, |
713 | slot_number); | 712 | slot_number); |
@@ -837,8 +836,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
837 | 836 | ||
838 | bus = pdev->subordinate; | 837 | bus = pdev->subordinate; |
839 | if (!bus) { | 838 | if (!bus) { |
840 | dev_notice(&pdev->dev, "the device is not a bridge, " | 839 | dev_notice(&pdev->dev, "the device is not a bridge, skipping\n"); |
841 | "skipping\n"); | ||
842 | rc = -ENODEV; | 840 | rc = -ENODEV; |
843 | goto err_disable_device; | 841 | goto err_disable_device; |
844 | } | 842 | } |
diff --git a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c index f593585f2784..bde47fce3248 100644 --- a/drivers/pci/hotplug/cpqphp_ctrl.c +++ b/drivers/pci/hotplug/cpqphp_ctrl.c | |||
@@ -39,9 +39,9 @@ | |||
39 | #include <linux/kthread.h> | 39 | #include <linux/kthread.h> |
40 | #include "cpqphp.h" | 40 | #include "cpqphp.h" |
41 | 41 | ||
42 | static u32 configure_new_device(struct controller* ctrl, struct pci_func *func, | 42 | static u32 configure_new_device(struct controller *ctrl, struct pci_func *func, |
43 | u8 behind_bridge, struct resource_lists *resources); | 43 | u8 behind_bridge, struct resource_lists *resources); |
44 | static int configure_new_function(struct controller* ctrl, struct pci_func *func, | 44 | static int configure_new_function(struct controller *ctrl, struct pci_func *func, |
45 | u8 behind_bridge, struct resource_lists *resources); | 45 | u8 behind_bridge, struct resource_lists *resources); |
46 | static void interrupt_event_handler(struct controller *ctrl); | 46 | static void interrupt_event_handler(struct controller *ctrl); |
47 | 47 | ||
@@ -64,7 +64,7 @@ static void long_delay(int delay) | |||
64 | 64 | ||
65 | /* FIXME: The following line needs to be somewhere else... */ | 65 | /* FIXME: The following line needs to be somewhere else... */ |
66 | #define WRONG_BUS_FREQUENCY 0x07 | 66 | #define WRONG_BUS_FREQUENCY 0x07 |
67 | static u8 handle_switch_change(u8 change, struct controller * ctrl) | 67 | static u8 handle_switch_change(u8 change, struct controller *ctrl) |
68 | { | 68 | { |
69 | int hp_slot; | 69 | int hp_slot; |
70 | u8 rc = 0; | 70 | u8 rc = 0; |
@@ -138,7 +138,7 @@ static struct slot *cpqhp_find_slot(struct controller *ctrl, u8 device) | |||
138 | } | 138 | } |
139 | 139 | ||
140 | 140 | ||
141 | static u8 handle_presence_change(u16 change, struct controller * ctrl) | 141 | static u8 handle_presence_change(u16 change, struct controller *ctrl) |
142 | { | 142 | { |
143 | int hp_slot; | 143 | int hp_slot; |
144 | u8 rc = 0; | 144 | u8 rc = 0; |
@@ -232,7 +232,7 @@ static u8 handle_presence_change(u16 change, struct controller * ctrl) | |||
232 | } | 232 | } |
233 | 233 | ||
234 | 234 | ||
235 | static u8 handle_power_fault(u8 change, struct controller * ctrl) | 235 | static u8 handle_power_fault(u8 change, struct controller *ctrl) |
236 | { | 236 | { |
237 | int hp_slot; | 237 | int hp_slot; |
238 | u8 rc = 0; | 238 | u8 rc = 0; |
@@ -997,7 +997,7 @@ struct pci_func *cpqhp_slot_create(u8 busnumber) | |||
997 | * | 997 | * |
998 | * Returns %0 if successful, !0 otherwise. | 998 | * Returns %0 if successful, !0 otherwise. |
999 | */ | 999 | */ |
1000 | static int slot_remove(struct pci_func * old_slot) | 1000 | static int slot_remove(struct pci_func *old_slot) |
1001 | { | 1001 | { |
1002 | struct pci_func *next; | 1002 | struct pci_func *next; |
1003 | 1003 | ||
@@ -1109,7 +1109,7 @@ struct pci_func *cpqhp_slot_find(u8 bus, u8 device, u8 index) | |||
1109 | 1109 | ||
1110 | /* DJZ: I don't think is_bridge will work as is. | 1110 | /* DJZ: I don't think is_bridge will work as is. |
1111 | * FIXME */ | 1111 | * FIXME */ |
1112 | static int is_bridge(struct pci_func * func) | 1112 | static int is_bridge(struct pci_func *func) |
1113 | { | 1113 | { |
1114 | /* Check the header type */ | 1114 | /* Check the header type */ |
1115 | if (((func->config_space[0x03] >> 16) & 0xFF) == 0x01) | 1115 | if (((func->config_space[0x03] >> 16) & 0xFF) == 0x01) |
@@ -1625,7 +1625,7 @@ static u32 board_added(struct pci_func *func, struct controller *ctrl) | |||
1625 | * @replace_flag: whether replacing or adding a new device | 1625 | * @replace_flag: whether replacing or adding a new device |
1626 | * @ctrl: target controller | 1626 | * @ctrl: target controller |
1627 | */ | 1627 | */ |
1628 | static u32 remove_board(struct pci_func * func, u32 replace_flag, struct controller * ctrl) | 1628 | static u32 remove_board(struct pci_func *func, u32 replace_flag, struct controller *ctrl) |
1629 | { | 1629 | { |
1630 | int index; | 1630 | int index; |
1631 | u8 skip = 0; | 1631 | u8 skip = 0; |
@@ -1742,7 +1742,7 @@ static void pushbutton_helper_thread(unsigned long data) | |||
1742 | 1742 | ||
1743 | 1743 | ||
1744 | /* this is the main worker thread */ | 1744 | /* this is the main worker thread */ |
1745 | static int event_thread(void* data) | 1745 | static int event_thread(void *data) |
1746 | { | 1746 | { |
1747 | struct controller *ctrl; | 1747 | struct controller *ctrl; |
1748 | 1748 | ||
@@ -1992,7 +1992,7 @@ int cpqhp_process_SI(struct controller *ctrl, struct pci_func *func) | |||
1992 | u16 temp_word; | 1992 | u16 temp_word; |
1993 | u32 tempdword; | 1993 | u32 tempdword; |
1994 | int rc; | 1994 | int rc; |
1995 | struct slot* p_slot; | 1995 | struct slot *p_slot; |
1996 | int physical_slot = 0; | 1996 | int physical_slot = 0; |
1997 | 1997 | ||
1998 | tempdword = 0; | 1998 | tempdword = 0; |
@@ -2088,7 +2088,7 @@ int cpqhp_process_SS(struct controller *ctrl, struct pci_func *func) | |||
2088 | u8 replace_flag; | 2088 | u8 replace_flag; |
2089 | u32 rc = 0; | 2089 | u32 rc = 0; |
2090 | unsigned int devfn; | 2090 | unsigned int devfn; |
2091 | struct slot* p_slot; | 2091 | struct slot *p_slot; |
2092 | struct pci_bus *pci_bus = ctrl->pci_bus; | 2092 | struct pci_bus *pci_bus = ctrl->pci_bus; |
2093 | int physical_slot=0; | 2093 | int physical_slot=0; |
2094 | 2094 | ||
@@ -2270,8 +2270,8 @@ int cpqhp_hardware_test(struct controller *ctrl, int test_num) | |||
2270 | * | 2270 | * |
2271 | * Returns 0 if success. | 2271 | * Returns 0 if success. |
2272 | */ | 2272 | */ |
2273 | static u32 configure_new_device(struct controller * ctrl, struct pci_func * func, | 2273 | static u32 configure_new_device(struct controller *ctrl, struct pci_func *func, |
2274 | u8 behind_bridge, struct resource_lists * resources) | 2274 | u8 behind_bridge, struct resource_lists *resources) |
2275 | { | 2275 | { |
2276 | u8 temp_byte, function, max_functions, stop_it; | 2276 | u8 temp_byte, function, max_functions, stop_it; |
2277 | int rc; | 2277 | int rc; |
diff --git a/drivers/pci/hotplug/cpqphp_nvram.c b/drivers/pci/hotplug/cpqphp_nvram.c index 9600a392eaae..0968a9bcb345 100644 --- a/drivers/pci/hotplug/cpqphp_nvram.c +++ b/drivers/pci/hotplug/cpqphp_nvram.c | |||
@@ -107,7 +107,7 @@ static spinlock_t int15_lock; | |||
107 | */ | 107 | */ |
108 | 108 | ||
109 | 109 | ||
110 | static u32 add_byte( u32 **p_buffer, u8 value, u32 *used, u32 *avail) | 110 | static u32 add_byte(u32 **p_buffer, u8 value, u32 *used, u32 *avail) |
111 | { | 111 | { |
112 | u8 **tByte; | 112 | u8 **tByte; |
113 | 113 | ||
@@ -122,7 +122,7 @@ static u32 add_byte( u32 **p_buffer, u8 value, u32 *used, u32 *avail) | |||
122 | } | 122 | } |
123 | 123 | ||
124 | 124 | ||
125 | static u32 add_dword( u32 **p_buffer, u32 value, u32 *used, u32 *avail) | 125 | static u32 add_dword(u32 **p_buffer, u32 value, u32 *used, u32 *avail) |
126 | { | 126 | { |
127 | if ((*used + 4) > *avail) | 127 | if ((*used + 4) > *avail) |
128 | return(1); | 128 | return(1); |
@@ -267,12 +267,12 @@ static u32 store_HRT (void __iomem *rom_start) | |||
267 | ctrl = cpqhp_ctrl_list; | 267 | ctrl = cpqhp_ctrl_list; |
268 | 268 | ||
269 | /* The revision of this structure */ | 269 | /* The revision of this structure */ |
270 | rc = add_byte( &pFill, 1 + ctrl->push_flag, &usedbytes, &available); | 270 | rc = add_byte(&pFill, 1 + ctrl->push_flag, &usedbytes, &available); |
271 | if (rc) | 271 | if (rc) |
272 | return(rc); | 272 | return(rc); |
273 | 273 | ||
274 | /* The number of controllers */ | 274 | /* The number of controllers */ |
275 | rc = add_byte( &pFill, 1, &usedbytes, &available); | 275 | rc = add_byte(&pFill, 1, &usedbytes, &available); |
276 | if (rc) | 276 | if (rc) |
277 | return(rc); | 277 | return(rc); |
278 | 278 | ||
@@ -282,22 +282,22 @@ static u32 store_HRT (void __iomem *rom_start) | |||
282 | numCtrl++; | 282 | numCtrl++; |
283 | 283 | ||
284 | /* The bus number */ | 284 | /* The bus number */ |
285 | rc = add_byte( &pFill, ctrl->bus, &usedbytes, &available); | 285 | rc = add_byte(&pFill, ctrl->bus, &usedbytes, &available); |
286 | if (rc) | 286 | if (rc) |
287 | return(rc); | 287 | return(rc); |
288 | 288 | ||
289 | /* The device Number */ | 289 | /* The device Number */ |
290 | rc = add_byte( &pFill, PCI_SLOT(ctrl->pci_dev->devfn), &usedbytes, &available); | 290 | rc = add_byte(&pFill, PCI_SLOT(ctrl->pci_dev->devfn), &usedbytes, &available); |
291 | if (rc) | 291 | if (rc) |
292 | return(rc); | 292 | return(rc); |
293 | 293 | ||
294 | /* The function Number */ | 294 | /* The function Number */ |
295 | rc = add_byte( &pFill, PCI_FUNC(ctrl->pci_dev->devfn), &usedbytes, &available); | 295 | rc = add_byte(&pFill, PCI_FUNC(ctrl->pci_dev->devfn), &usedbytes, &available); |
296 | if (rc) | 296 | if (rc) |
297 | return(rc); | 297 | return(rc); |
298 | 298 | ||
299 | /* Skip the number of available entries */ | 299 | /* Skip the number of available entries */ |
300 | rc = add_dword( &pFill, 0, &usedbytes, &available); | 300 | rc = add_dword(&pFill, 0, &usedbytes, &available); |
301 | if (rc) | 301 | if (rc) |
302 | return(rc); | 302 | return(rc); |
303 | 303 | ||
@@ -311,12 +311,12 @@ static u32 store_HRT (void __iomem *rom_start) | |||
311 | loop ++; | 311 | loop ++; |
312 | 312 | ||
313 | /* base */ | 313 | /* base */ |
314 | rc = add_dword( &pFill, resNode->base, &usedbytes, &available); | 314 | rc = add_dword(&pFill, resNode->base, &usedbytes, &available); |
315 | if (rc) | 315 | if (rc) |
316 | return(rc); | 316 | return(rc); |
317 | 317 | ||
318 | /* length */ | 318 | /* length */ |
319 | rc = add_dword( &pFill, resNode->length, &usedbytes, &available); | 319 | rc = add_dword(&pFill, resNode->length, &usedbytes, &available); |
320 | if (rc) | 320 | if (rc) |
321 | return(rc); | 321 | return(rc); |
322 | 322 | ||
@@ -336,12 +336,12 @@ static u32 store_HRT (void __iomem *rom_start) | |||
336 | loop ++; | 336 | loop ++; |
337 | 337 | ||
338 | /* base */ | 338 | /* base */ |
339 | rc = add_dword( &pFill, resNode->base, &usedbytes, &available); | 339 | rc = add_dword(&pFill, resNode->base, &usedbytes, &available); |
340 | if (rc) | 340 | if (rc) |
341 | return(rc); | 341 | return(rc); |
342 | 342 | ||
343 | /* length */ | 343 | /* length */ |
344 | rc = add_dword( &pFill, resNode->length, &usedbytes, &available); | 344 | rc = add_dword(&pFill, resNode->length, &usedbytes, &available); |
345 | if (rc) | 345 | if (rc) |
346 | return(rc); | 346 | return(rc); |
347 | 347 | ||
@@ -361,12 +361,12 @@ static u32 store_HRT (void __iomem *rom_start) | |||
361 | loop ++; | 361 | loop ++; |
362 | 362 | ||
363 | /* base */ | 363 | /* base */ |
364 | rc = add_dword( &pFill, resNode->base, &usedbytes, &available); | 364 | rc = add_dword(&pFill, resNode->base, &usedbytes, &available); |
365 | if (rc) | 365 | if (rc) |
366 | return(rc); | 366 | return(rc); |
367 | 367 | ||
368 | /* length */ | 368 | /* length */ |
369 | rc = add_dword( &pFill, resNode->length, &usedbytes, &available); | 369 | rc = add_dword(&pFill, resNode->length, &usedbytes, &available); |
370 | if (rc) | 370 | if (rc) |
371 | return(rc); | 371 | return(rc); |
372 | 372 | ||
@@ -386,12 +386,12 @@ static u32 store_HRT (void __iomem *rom_start) | |||
386 | loop ++; | 386 | loop ++; |
387 | 387 | ||
388 | /* base */ | 388 | /* base */ |
389 | rc = add_dword( &pFill, resNode->base, &usedbytes, &available); | 389 | rc = add_dword(&pFill, resNode->base, &usedbytes, &available); |
390 | if (rc) | 390 | if (rc) |
391 | return(rc); | 391 | return(rc); |
392 | 392 | ||
393 | /* length */ | 393 | /* length */ |
394 | rc = add_dword( &pFill, resNode->length, &usedbytes, &available); | 394 | rc = add_dword(&pFill, resNode->length, &usedbytes, &available); |
395 | if (rc) | 395 | if (rc) |
396 | return(rc); | 396 | return(rc); |
397 | 397 | ||
diff --git a/drivers/pci/hotplug/cpqphp_pci.c b/drivers/pci/hotplug/cpqphp_pci.c index a3e3c2002b58..1c8c2f130d31 100644 --- a/drivers/pci/hotplug/cpqphp_pci.c +++ b/drivers/pci/hotplug/cpqphp_pci.c | |||
@@ -81,7 +81,7 @@ static void __iomem *detect_HRT_floating_pointer(void __iomem *begin, void __iom | |||
81 | } | 81 | } |
82 | 82 | ||
83 | 83 | ||
84 | int cpqhp_configure_device (struct controller* ctrl, struct pci_func* func) | 84 | int cpqhp_configure_device (struct controller *ctrl, struct pci_func *func) |
85 | { | 85 | { |
86 | struct pci_bus *child; | 86 | struct pci_bus *child; |
87 | int num; | 87 | int num; |
@@ -121,7 +121,7 @@ int cpqhp_configure_device (struct controller* ctrl, struct pci_func* func) | |||
121 | } | 121 | } |
122 | 122 | ||
123 | 123 | ||
124 | int cpqhp_unconfigure_device(struct pci_func* func) | 124 | int cpqhp_unconfigure_device(struct pci_func *func) |
125 | { | 125 | { |
126 | int j; | 126 | int j; |
127 | 127 | ||
@@ -129,7 +129,7 @@ int cpqhp_unconfigure_device(struct pci_func* func) | |||
129 | 129 | ||
130 | pci_lock_rescan_remove(); | 130 | pci_lock_rescan_remove(); |
131 | for (j=0; j<8 ; j++) { | 131 | for (j=0; j<8 ; j++) { |
132 | struct pci_dev* temp = pci_get_bus_and_slot(func->bus, PCI_DEVFN(func->device, j)); | 132 | struct pci_dev *temp = pci_get_bus_and_slot(func->bus, PCI_DEVFN(func->device, j)); |
133 | if (temp) { | 133 | if (temp) { |
134 | pci_dev_put(temp); | 134 | pci_dev_put(temp); |
135 | pci_stop_and_remove_bus_device(temp); | 135 | pci_stop_and_remove_bus_device(temp); |
@@ -203,7 +203,7 @@ int cpqhp_set_irq (u8 bus_num, u8 dev_num, u8 int_pin, u8 irq_num) | |||
203 | } | 203 | } |
204 | 204 | ||
205 | 205 | ||
206 | static int PCI_ScanBusForNonBridge(struct controller *ctrl, u8 bus_num, u8 * dev_num) | 206 | static int PCI_ScanBusForNonBridge(struct controller *ctrl, u8 bus_num, u8 *dev_num) |
207 | { | 207 | { |
208 | u16 tdevice; | 208 | u16 tdevice; |
209 | u32 work; | 209 | u32 work; |
@@ -280,7 +280,7 @@ static int PCI_GetBusDevHelper(struct controller *ctrl, u8 *bus_num, u8 *dev_num | |||
280 | } | 280 | } |
281 | 281 | ||
282 | 282 | ||
283 | int cpqhp_get_bus_dev (struct controller *ctrl, u8 * bus_num, u8 * dev_num, u8 slot) | 283 | int cpqhp_get_bus_dev (struct controller *ctrl, u8 *bus_num, u8 *dev_num, u8 slot) |
284 | { | 284 | { |
285 | /* plain (bridges allowed) */ | 285 | /* plain (bridges allowed) */ |
286 | return PCI_GetBusDevHelper(ctrl, bus_num, dev_num, slot, 0); | 286 | return PCI_GetBusDevHelper(ctrl, bus_num, dev_num, slot, 0); |
@@ -465,7 +465,7 @@ int cpqhp_save_config(struct controller *ctrl, int busnumber, int is_hot_plug) | |||
465 | * | 465 | * |
466 | * returns 0 if success | 466 | * returns 0 if success |
467 | */ | 467 | */ |
468 | int cpqhp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot) | 468 | int cpqhp_save_slot_config (struct controller *ctrl, struct pci_func *new_slot) |
469 | { | 469 | { |
470 | long rc; | 470 | long rc; |
471 | u8 class_code; | 471 | u8 class_code; |
@@ -549,7 +549,7 @@ int cpqhp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot) | |||
549 | * | 549 | * |
550 | * returns 0 if success | 550 | * returns 0 if success |
551 | */ | 551 | */ |
552 | int cpqhp_save_base_addr_length(struct controller *ctrl, struct pci_func * func) | 552 | int cpqhp_save_base_addr_length(struct controller *ctrl, struct pci_func *func) |
553 | { | 553 | { |
554 | u8 cloop; | 554 | u8 cloop; |
555 | u8 header_type; | 555 | u8 header_type; |
@@ -686,7 +686,7 @@ int cpqhp_save_base_addr_length(struct controller *ctrl, struct pci_func * func) | |||
686 | * | 686 | * |
687 | * returns 0 if success | 687 | * returns 0 if success |
688 | */ | 688 | */ |
689 | int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func) | 689 | int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func *func) |
690 | { | 690 | { |
691 | u8 cloop; | 691 | u8 cloop; |
692 | u8 header_type; | 692 | u8 header_type; |
@@ -949,7 +949,7 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func) | |||
949 | * | 949 | * |
950 | * returns 0 if success | 950 | * returns 0 if success |
951 | */ | 951 | */ |
952 | int cpqhp_configure_board(struct controller *ctrl, struct pci_func * func) | 952 | int cpqhp_configure_board(struct controller *ctrl, struct pci_func *func) |
953 | { | 953 | { |
954 | int cloop; | 954 | int cloop; |
955 | u8 header_type; | 955 | u8 header_type; |
@@ -1027,7 +1027,7 @@ int cpqhp_configure_board(struct controller *ctrl, struct pci_func * func) | |||
1027 | * | 1027 | * |
1028 | * returns 0 if the board is the same nonzero otherwise | 1028 | * returns 0 if the board is the same nonzero otherwise |
1029 | */ | 1029 | */ |
1030 | int cpqhp_valid_replace(struct controller *ctrl, struct pci_func * func) | 1030 | int cpqhp_valid_replace(struct controller *ctrl, struct pci_func *func) |
1031 | { | 1031 | { |
1032 | u8 cloop; | 1032 | u8 cloop; |
1033 | u8 header_type; | 1033 | u8 header_type; |
@@ -1419,7 +1419,7 @@ int cpqhp_find_available_resources(struct controller *ctrl, void __iomem *rom_st | |||
1419 | * | 1419 | * |
1420 | * returns 0 if success | 1420 | * returns 0 if success |
1421 | */ | 1421 | */ |
1422 | int cpqhp_return_board_resources(struct pci_func * func, struct resource_lists * resources) | 1422 | int cpqhp_return_board_resources(struct pci_func *func, struct resource_lists *resources) |
1423 | { | 1423 | { |
1424 | int rc = 0; | 1424 | int rc = 0; |
1425 | struct pci_resource *node; | 1425 | struct pci_resource *node; |
@@ -1475,7 +1475,7 @@ int cpqhp_return_board_resources(struct pci_func * func, struct resource_lists * | |||
1475 | * | 1475 | * |
1476 | * Puts node back in the resource list pointed to by head | 1476 | * Puts node back in the resource list pointed to by head |
1477 | */ | 1477 | */ |
1478 | void cpqhp_destroy_resource_list (struct resource_lists * resources) | 1478 | void cpqhp_destroy_resource_list (struct resource_lists *resources) |
1479 | { | 1479 | { |
1480 | struct pci_resource *res, *tres; | 1480 | struct pci_resource *res, *tres; |
1481 | 1481 | ||
@@ -1522,7 +1522,7 @@ void cpqhp_destroy_resource_list (struct resource_lists * resources) | |||
1522 | * | 1522 | * |
1523 | * Puts node back in the resource list pointed to by head | 1523 | * Puts node back in the resource list pointed to by head |
1524 | */ | 1524 | */ |
1525 | void cpqhp_destroy_board_resources (struct pci_func * func) | 1525 | void cpqhp_destroy_board_resources (struct pci_func *func) |
1526 | { | 1526 | { |
1527 | struct pci_resource *res, *tres; | 1527 | struct pci_resource *res, *tres; |
1528 | 1528 | ||
diff --git a/drivers/pci/hotplug/cpqphp_sysfs.c b/drivers/pci/hotplug/cpqphp_sysfs.c index 17c1f36315d1..4a392c44e3d3 100644 --- a/drivers/pci/hotplug/cpqphp_sysfs.c +++ b/drivers/pci/hotplug/cpqphp_sysfs.c | |||
@@ -79,7 +79,7 @@ static int show_ctrl (struct controller *ctrl, char *buf) | |||
79 | 79 | ||
80 | static int show_dev (struct controller *ctrl, char *buf) | 80 | static int show_dev (struct controller *ctrl, char *buf) |
81 | { | 81 | { |
82 | char * out = buf; | 82 | char *out = buf; |
83 | int index; | 83 | int index; |
84 | struct pci_resource *res; | 84 | struct pci_resource *res; |
85 | struct pci_func *new_slot; | 85 | struct pci_func *new_slot; |
diff --git a/drivers/pci/hotplug/ibmphp_core.c b/drivers/pci/hotplug/ibmphp_core.c index cf3ac1e4b099..f7b8684a7739 100644 --- a/drivers/pci/hotplug/ibmphp_core.c +++ b/drivers/pci/hotplug/ibmphp_core.c | |||
@@ -74,7 +74,7 @@ static inline int get_max_adapter_speed (struct hotplug_slot *hs, u8 *value) | |||
74 | static inline int get_cur_bus_info(struct slot **sl) | 74 | static inline int get_cur_bus_info(struct slot **sl) |
75 | { | 75 | { |
76 | int rc = 1; | 76 | int rc = 1; |
77 | struct slot * slot_cur = *sl; | 77 | struct slot *slot_cur = *sl; |
78 | 78 | ||
79 | debug("options = %x\n", slot_cur->ctrl->options); | 79 | debug("options = %x\n", slot_cur->ctrl->options); |
80 | debug("revision = %x\n", slot_cur->ctrl->revision); | 80 | debug("revision = %x\n", slot_cur->ctrl->revision); |
@@ -114,8 +114,8 @@ static inline int slot_update(struct slot **sl) | |||
114 | 114 | ||
115 | static int __init get_max_slots (void) | 115 | static int __init get_max_slots (void) |
116 | { | 116 | { |
117 | struct slot * slot_cur; | 117 | struct slot *slot_cur; |
118 | struct list_head * tmp; | 118 | struct list_head *tmp; |
119 | u8 slot_count = 0; | 119 | u8 slot_count = 0; |
120 | 120 | ||
121 | list_for_each(tmp, &ibmphp_slot_head) { | 121 | list_for_each(tmp, &ibmphp_slot_head) { |
@@ -280,7 +280,7 @@ static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 value) | |||
280 | return rc; | 280 | return rc; |
281 | } | 281 | } |
282 | 282 | ||
283 | static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 * value) | 283 | static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value) |
284 | { | 284 | { |
285 | int rc = -ENODEV; | 285 | int rc = -ENODEV; |
286 | struct slot *pslot; | 286 | struct slot *pslot; |
@@ -311,7 +311,7 @@ static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 * value) | |||
311 | return rc; | 311 | return rc; |
312 | } | 312 | } |
313 | 313 | ||
314 | static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 * value) | 314 | static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value) |
315 | { | 315 | { |
316 | int rc = -ENODEV; | 316 | int rc = -ENODEV; |
317 | struct slot *pslot; | 317 | struct slot *pslot; |
@@ -338,7 +338,7 @@ static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 * value) | |||
338 | } | 338 | } |
339 | 339 | ||
340 | 340 | ||
341 | static int get_power_status(struct hotplug_slot *hotplug_slot, u8 * value) | 341 | static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value) |
342 | { | 342 | { |
343 | int rc = -ENODEV; | 343 | int rc = -ENODEV; |
344 | struct slot *pslot; | 344 | struct slot *pslot; |
@@ -364,7 +364,7 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 * value) | |||
364 | return rc; | 364 | return rc; |
365 | } | 365 | } |
366 | 366 | ||
367 | static int get_adapter_present(struct hotplug_slot *hotplug_slot, u8 * value) | 367 | static int get_adapter_present(struct hotplug_slot *hotplug_slot, u8 *value) |
368 | { | 368 | { |
369 | int rc = -ENODEV; | 369 | int rc = -ENODEV; |
370 | struct slot *pslot; | 370 | struct slot *pslot; |
@@ -433,7 +433,7 @@ static int get_max_bus_speed(struct slot *slot) | |||
433 | } | 433 | } |
434 | 434 | ||
435 | /* | 435 | /* |
436 | static int get_max_adapter_speed_1(struct hotplug_slot *hotplug_slot, u8 * value, u8 flag) | 436 | static int get_max_adapter_speed_1(struct hotplug_slot *hotplug_slot, u8 *value, u8 flag) |
437 | { | 437 | { |
438 | int rc = -ENODEV; | 438 | int rc = -ENODEV; |
439 | struct slot *pslot; | 439 | struct slot *pslot; |
@@ -471,7 +471,7 @@ static int get_max_adapter_speed_1(struct hotplug_slot *hotplug_slot, u8 * value | |||
471 | return rc; | 471 | return rc; |
472 | } | 472 | } |
473 | 473 | ||
474 | static int get_bus_name(struct hotplug_slot *hotplug_slot, char * value) | 474 | static int get_bus_name(struct hotplug_slot *hotplug_slot, char *value) |
475 | { | 475 | { |
476 | int rc = -ENODEV; | 476 | int rc = -ENODEV; |
477 | struct slot *pslot = NULL; | 477 | struct slot *pslot = NULL; |
@@ -671,7 +671,7 @@ static struct pci_func *ibm_slot_find(u8 busno, u8 device, u8 function) | |||
671 | { | 671 | { |
672 | struct pci_func *func_cur; | 672 | struct pci_func *func_cur; |
673 | struct slot *slot_cur; | 673 | struct slot *slot_cur; |
674 | struct list_head * tmp; | 674 | struct list_head *tmp; |
675 | list_for_each(tmp, &ibmphp_slot_head) { | 675 | list_for_each(tmp, &ibmphp_slot_head) { |
676 | slot_cur = list_entry(tmp, struct slot, ibm_slot_list); | 676 | slot_cur = list_entry(tmp, struct slot, ibm_slot_list); |
677 | if (slot_cur->func) { | 677 | if (slot_cur->func) { |
@@ -696,8 +696,8 @@ static struct pci_func *ibm_slot_find(u8 busno, u8 device, u8 function) | |||
696 | static void free_slots(void) | 696 | static void free_slots(void) |
697 | { | 697 | { |
698 | struct slot *slot_cur; | 698 | struct slot *slot_cur; |
699 | struct list_head * tmp; | 699 | struct list_head *tmp; |
700 | struct list_head * next; | 700 | struct list_head *next; |
701 | 701 | ||
702 | debug("%s -- enter\n", __func__); | 702 | debug("%s -- enter\n", __func__); |
703 | 703 | ||
@@ -825,10 +825,10 @@ static int ibm_configure_device(struct pci_func *func) | |||
825 | /******************************************************* | 825 | /******************************************************* |
826 | * Returns whether the bus is empty or not | 826 | * Returns whether the bus is empty or not |
827 | *******************************************************/ | 827 | *******************************************************/ |
828 | static int is_bus_empty(struct slot * slot_cur) | 828 | static int is_bus_empty(struct slot *slot_cur) |
829 | { | 829 | { |
830 | int rc; | 830 | int rc; |
831 | struct slot * tmp_slot; | 831 | struct slot *tmp_slot; |
832 | u8 i = slot_cur->bus_on->slot_min; | 832 | u8 i = slot_cur->bus_on->slot_min; |
833 | 833 | ||
834 | while (i <= slot_cur->bus_on->slot_max) { | 834 | while (i <= slot_cur->bus_on->slot_max) { |
@@ -856,7 +856,7 @@ static int is_bus_empty(struct slot * slot_cur) | |||
856 | * Parameters: slot | 856 | * Parameters: slot |
857 | * Returns: bus is set (0) or error code | 857 | * Returns: bus is set (0) or error code |
858 | ***********************************************************/ | 858 | ***********************************************************/ |
859 | static int set_bus(struct slot * slot_cur) | 859 | static int set_bus(struct slot *slot_cur) |
860 | { | 860 | { |
861 | int rc; | 861 | int rc; |
862 | u8 speed; | 862 | u8 speed; |
@@ -956,7 +956,7 @@ static int set_bus(struct slot * slot_cur) | |||
956 | static int check_limitations(struct slot *slot_cur) | 956 | static int check_limitations(struct slot *slot_cur) |
957 | { | 957 | { |
958 | u8 i; | 958 | u8 i; |
959 | struct slot * tmp_slot; | 959 | struct slot *tmp_slot; |
960 | u8 count = 0; | 960 | u8 count = 0; |
961 | u8 limitation = 0; | 961 | u8 limitation = 0; |
962 | 962 | ||
@@ -1045,8 +1045,7 @@ static int enable_slot(struct hotplug_slot *hs) | |||
1045 | rc = check_limitations(slot_cur); | 1045 | rc = check_limitations(slot_cur); |
1046 | if (rc) { | 1046 | if (rc) { |
1047 | err("Adding this card exceeds the limitations of this bus.\n"); | 1047 | err("Adding this card exceeds the limitations of this bus.\n"); |
1048 | err("(i.e., >1 133MHz cards running on same bus, or " | 1048 | err("(i.e., >1 133MHz cards running on same bus, or >2 66 PCI cards running on same bus.\n"); |
1049 | ">2 66 PCI cards running on same bus.\n"); | ||
1050 | err("Try hot-adding into another bus\n"); | 1049 | err("Try hot-adding into another bus\n"); |
1051 | rc = -EINVAL; | 1050 | rc = -EINVAL; |
1052 | goto error_nopower; | 1051 | goto error_nopower; |
@@ -1070,12 +1069,10 @@ static int enable_slot(struct hotplug_slot *hs) | |||
1070 | !(SLOT_PWRGD(slot_cur->status))) | 1069 | !(SLOT_PWRGD(slot_cur->status))) |
1071 | err("power fault occurred trying to power up\n"); | 1070 | err("power fault occurred trying to power up\n"); |
1072 | else if (SLOT_BUS_SPEED(slot_cur->status)) { | 1071 | else if (SLOT_BUS_SPEED(slot_cur->status)) { |
1073 | err("bus speed mismatch occurred. please check " | 1072 | err("bus speed mismatch occurred. please check current bus speed and card capability\n"); |
1074 | "current bus speed and card capability\n"); | ||
1075 | print_card_capability(slot_cur); | 1073 | print_card_capability(slot_cur); |
1076 | } else if (SLOT_BUS_MODE(slot_cur->ext_status)) { | 1074 | } else if (SLOT_BUS_MODE(slot_cur->ext_status)) { |
1077 | err("bus mode mismatch occurred. please check " | 1075 | err("bus mode mismatch occurred. please check current bus mode and card capability\n"); |
1078 | "current bus mode and card capability\n"); | ||
1079 | print_card_capability(slot_cur); | 1076 | print_card_capability(slot_cur); |
1080 | } | 1077 | } |
1081 | ibmphp_update_slot_info(slot_cur); | 1078 | ibmphp_update_slot_info(slot_cur); |
@@ -1098,8 +1095,7 @@ static int enable_slot(struct hotplug_slot *hs) | |||
1098 | goto error_power; | 1095 | goto error_power; |
1099 | } | 1096 | } |
1100 | if (SLOT_POWER(slot_cur->status) && (SLOT_BUS_SPEED(slot_cur->status))) { | 1097 | if (SLOT_POWER(slot_cur->status) && (SLOT_BUS_SPEED(slot_cur->status))) { |
1101 | err("bus speed mismatch occurred. please check current bus " | 1098 | err("bus speed mismatch occurred. please check current bus speed and card capability\n"); |
1102 | "speed and card capability\n"); | ||
1103 | print_card_capability(slot_cur); | 1099 | print_card_capability(slot_cur); |
1104 | goto error_power; | 1100 | goto error_power; |
1105 | } | 1101 | } |
diff --git a/drivers/pci/hotplug/ibmphp_ebda.c b/drivers/pci/hotplug/ibmphp_ebda.c index bd044158b36c..0f65ac555434 100644 --- a/drivers/pci/hotplug/ibmphp_ebda.c +++ b/drivers/pci/hotplug/ibmphp_ebda.c | |||
@@ -563,7 +563,7 @@ static int first_slot_num (u8 slot_num, u8 first_slot, u8 var) | |||
563 | return rc; | 563 | return rc; |
564 | } | 564 | } |
565 | 565 | ||
566 | static struct opt_rio_lo * find_rxe_num (u8 slot_num) | 566 | static struct opt_rio_lo *find_rxe_num (u8 slot_num) |
567 | { | 567 | { |
568 | struct opt_rio_lo *opt_lo_ptr; | 568 | struct opt_rio_lo *opt_lo_ptr; |
569 | 569 | ||
@@ -575,7 +575,7 @@ static struct opt_rio_lo * find_rxe_num (u8 slot_num) | |||
575 | return NULL; | 575 | return NULL; |
576 | } | 576 | } |
577 | 577 | ||
578 | static struct opt_rio * find_chassis_num (u8 slot_num) | 578 | static struct opt_rio *find_chassis_num (u8 slot_num) |
579 | { | 579 | { |
580 | struct opt_rio *opt_vg_ptr; | 580 | struct opt_rio *opt_vg_ptr; |
581 | 581 | ||
@@ -593,7 +593,7 @@ static struct opt_rio * find_chassis_num (u8 slot_num) | |||
593 | static u8 calculate_first_slot (u8 slot_num) | 593 | static u8 calculate_first_slot (u8 slot_num) |
594 | { | 594 | { |
595 | u8 first_slot = 1; | 595 | u8 first_slot = 1; |
596 | struct slot * slot_cur; | 596 | struct slot *slot_cur; |
597 | 597 | ||
598 | list_for_each_entry(slot_cur, &ibmphp_slot_head, ibm_slot_list) { | 598 | list_for_each_entry(slot_cur, &ibmphp_slot_head, ibm_slot_list) { |
599 | if (slot_cur->ctrl) { | 599 | if (slot_cur->ctrl) { |
@@ -607,7 +607,7 @@ static u8 calculate_first_slot (u8 slot_num) | |||
607 | 607 | ||
608 | #define SLOT_NAME_SIZE 30 | 608 | #define SLOT_NAME_SIZE 30 |
609 | 609 | ||
610 | static char *create_file_name (struct slot * slot_cur) | 610 | static char *create_file_name (struct slot *slot_cur) |
611 | { | 611 | { |
612 | struct opt_rio *opt_vg_ptr = NULL; | 612 | struct opt_rio *opt_vg_ptr = NULL; |
613 | struct opt_rio_lo *opt_lo_ptr = NULL; | 613 | struct opt_rio_lo *opt_lo_ptr = NULL; |
@@ -1192,7 +1192,7 @@ int ibmphp_register_pci (void) | |||
1192 | } | 1192 | } |
1193 | return rc; | 1193 | return rc; |
1194 | } | 1194 | } |
1195 | static int ibmphp_probe (struct pci_dev * dev, const struct pci_device_id *ids) | 1195 | static int ibmphp_probe (struct pci_dev *dev, const struct pci_device_id *ids) |
1196 | { | 1196 | { |
1197 | struct controller *ctrl; | 1197 | struct controller *ctrl; |
1198 | 1198 | ||
diff --git a/drivers/pci/hotplug/ibmphp_hpc.c b/drivers/pci/hotplug/ibmphp_hpc.c index 5fc7a089f532..a936022956e6 100644 --- a/drivers/pci/hotplug/ibmphp_hpc.c +++ b/drivers/pci/hotplug/ibmphp_hpc.c | |||
@@ -533,7 +533,7 @@ static u8 hpc_readcmdtoindex (u8 cmd, u8 index) | |||
533 | * | 533 | * |
534 | * Return 0 or error codes | 534 | * Return 0 or error codes |
535 | *---------------------------------------------------------------------*/ | 535 | *---------------------------------------------------------------------*/ |
536 | int ibmphp_hpc_readslot (struct slot * pslot, u8 cmd, u8 * pstatus) | 536 | int ibmphp_hpc_readslot (struct slot *pslot, u8 cmd, u8 *pstatus) |
537 | { | 537 | { |
538 | void __iomem *wpg_bbar = NULL; | 538 | void __iomem *wpg_bbar = NULL; |
539 | struct controller *ctlr_ptr; | 539 | struct controller *ctlr_ptr; |
@@ -672,7 +672,7 @@ int ibmphp_hpc_readslot (struct slot * pslot, u8 cmd, u8 * pstatus) | |||
672 | * | 672 | * |
673 | * Action: issue a WRITE command to HPC | 673 | * Action: issue a WRITE command to HPC |
674 | *---------------------------------------------------------------------*/ | 674 | *---------------------------------------------------------------------*/ |
675 | int ibmphp_hpc_writeslot (struct slot * pslot, u8 cmd) | 675 | int ibmphp_hpc_writeslot (struct slot *pslot, u8 cmd) |
676 | { | 676 | { |
677 | void __iomem *wpg_bbar = NULL; | 677 | void __iomem *wpg_bbar = NULL; |
678 | struct controller *ctlr_ptr; | 678 | struct controller *ctlr_ptr; |
@@ -1102,7 +1102,7 @@ void __exit ibmphp_hpc_stop_poll_thread (void) | |||
1102 | * Value: | 1102 | * Value: |
1103 | *---------------------------------------------------------------------*/ | 1103 | *---------------------------------------------------------------------*/ |
1104 | static int hpc_wait_ctlr_notworking (int timeout, struct controller *ctlr_ptr, void __iomem *wpg_bbar, | 1104 | static int hpc_wait_ctlr_notworking (int timeout, struct controller *ctlr_ptr, void __iomem *wpg_bbar, |
1105 | u8 * pstatus) | 1105 | u8 *pstatus) |
1106 | { | 1106 | { |
1107 | int rc = 0; | 1107 | int rc = 0; |
1108 | u8 done = 0; | 1108 | u8 done = 0; |
diff --git a/drivers/pci/hotplug/ibmphp_pci.c b/drivers/pci/hotplug/ibmphp_pci.c index 639ea3a75e14..2fd296706ce7 100644 --- a/drivers/pci/hotplug/ibmphp_pci.c +++ b/drivers/pci/hotplug/ibmphp_pci.c | |||
@@ -47,7 +47,7 @@ static u8 find_sec_number (u8 primary_busno, u8 slotno); | |||
47 | * We also assign the same irq numbers for multi function devices. | 47 | * We also assign the same irq numbers for multi function devices. |
48 | * These are PIC mode, so shouldn't matter n.e.ways (hopefully) | 48 | * These are PIC mode, so shouldn't matter n.e.ways (hopefully) |
49 | */ | 49 | */ |
50 | static void assign_alt_irq (struct pci_func * cur_func, u8 class_code) | 50 | static void assign_alt_irq (struct pci_func *cur_func, u8 class_code) |
51 | { | 51 | { |
52 | int j; | 52 | int j; |
53 | for (j = 0; j < 4; j++) { | 53 | for (j = 0; j < 4; j++) { |
@@ -137,8 +137,8 @@ int ibmphp_configure_card (struct pci_func *func, u8 slotno) | |||
137 | "Please choose another device.\n", cur_func->device); | 137 | "Please choose another device.\n", cur_func->device); |
138 | return -ENODEV; | 138 | return -ENODEV; |
139 | } else if (class == PCI_CLASS_DISPLAY_VGA) { | 139 | } else if (class == PCI_CLASS_DISPLAY_VGA) { |
140 | err ("The device %x is not supported for hot plugging. " | 140 | err ("The device %x is not supported for hot plugging. Please choose another device.\n", |
141 | "Please choose another device.\n", cur_func->device); | 141 | cur_func->device); |
142 | return -ENODEV; | 142 | return -ENODEV; |
143 | } | 143 | } |
144 | switch (hdr_type) { | 144 | switch (hdr_type) { |
@@ -179,8 +179,8 @@ int ibmphp_configure_card (struct pci_func *func, u8 slotno) | |||
179 | case PCI_HEADER_TYPE_MULTIBRIDGE: | 179 | case PCI_HEADER_TYPE_MULTIBRIDGE: |
180 | class >>= 8; | 180 | class >>= 8; |
181 | if (class != PCI_CLASS_BRIDGE_PCI) { | 181 | if (class != PCI_CLASS_BRIDGE_PCI) { |
182 | err ("This %x is not PCI-to-PCI bridge, and as is not supported for hot-plugging. " | 182 | err ("This %x is not PCI-to-PCI bridge, and as is not supported for hot-plugging. Please insert another card.\n", |
183 | "Please insert another card.\n", cur_func->device); | 183 | cur_func->device); |
184 | return -ENODEV; | 184 | return -ENODEV; |
185 | } | 185 | } |
186 | assign_alt_irq (cur_func, class_code); | 186 | assign_alt_irq (cur_func, class_code); |
@@ -247,8 +247,8 @@ int ibmphp_configure_card (struct pci_func *func, u8 slotno) | |||
247 | class >>= 8; | 247 | class >>= 8; |
248 | debug ("class now is %x\n", class); | 248 | debug ("class now is %x\n", class); |
249 | if (class != PCI_CLASS_BRIDGE_PCI) { | 249 | if (class != PCI_CLASS_BRIDGE_PCI) { |
250 | err ("This %x is not PCI-to-PCI bridge, and as is not supported for hot-plugging. " | 250 | err ("This %x is not PCI-to-PCI bridge, and as is not supported for hot-plugging. Please insert another card.\n", |
251 | "Please insert another card.\n", cur_func->device); | 251 | cur_func->device); |
252 | return -ENODEV; | 252 | return -ENODEV; |
253 | } | 253 | } |
254 | 254 | ||
@@ -1073,7 +1073,7 @@ error: | |||
1073 | * Input: bridge function | 1073 | * Input: bridge function |
1074 | * Output: amount of resources needed | 1074 | * Output: amount of resources needed |
1075 | *****************************************************************************/ | 1075 | *****************************************************************************/ |
1076 | static struct res_needed *scan_behind_bridge (struct pci_func * func, u8 busno) | 1076 | static struct res_needed *scan_behind_bridge (struct pci_func *func, u8 busno) |
1077 | { | 1077 | { |
1078 | int count, len[6]; | 1078 | int count, len[6]; |
1079 | u16 vendor_id; | 1079 | u16 vendor_id; |
@@ -1125,13 +1125,11 @@ static struct res_needed *scan_behind_bridge (struct pci_func * func, u8 busno) | |||
1125 | 1125 | ||
1126 | class >>= 8; /* to take revision out, class = class.subclass.prog i/f */ | 1126 | class >>= 8; /* to take revision out, class = class.subclass.prog i/f */ |
1127 | if (class == PCI_CLASS_NOT_DEFINED_VGA) { | 1127 | if (class == PCI_CLASS_NOT_DEFINED_VGA) { |
1128 | err ("The device %x is VGA compatible and as is not supported for hot plugging. " | 1128 | err ("The device %x is VGA compatible and as is not supported for hot plugging. Please choose another device.\n", device); |
1129 | "Please choose another device.\n", device); | ||
1130 | amount->not_correct = 1; | 1129 | amount->not_correct = 1; |
1131 | return amount; | 1130 | return amount; |
1132 | } else if (class == PCI_CLASS_DISPLAY_VGA) { | 1131 | } else if (class == PCI_CLASS_DISPLAY_VGA) { |
1133 | err ("The device %x is not supported for hot plugging. " | 1132 | err ("The device %x is not supported for hot plugging. Please choose another device.\n", device); |
1134 | "Please choose another device.\n", device); | ||
1135 | amount->not_correct = 1; | 1133 | amount->not_correct = 1; |
1136 | return amount; | 1134 | return amount; |
1137 | } | 1135 | } |
@@ -1483,12 +1481,10 @@ static int unconfigure_boot_card (struct slot *slot_cur) | |||
1483 | debug ("hdr_type %x, class %x\n", hdr_type, class); | 1481 | debug ("hdr_type %x, class %x\n", hdr_type, class); |
1484 | class >>= 8; /* to take revision out, class = class.subclass.prog i/f */ | 1482 | class >>= 8; /* to take revision out, class = class.subclass.prog i/f */ |
1485 | if (class == PCI_CLASS_NOT_DEFINED_VGA) { | 1483 | if (class == PCI_CLASS_NOT_DEFINED_VGA) { |
1486 | err ("The device %x function %x is VGA compatible and is not supported for hot removing. " | 1484 | err ("The device %x function %x is VGA compatible and is not supported for hot removing. Please choose another device.\n", device, function); |
1487 | "Please choose another device.\n", device, function); | ||
1488 | return -ENODEV; | 1485 | return -ENODEV; |
1489 | } else if (class == PCI_CLASS_DISPLAY_VGA) { | 1486 | } else if (class == PCI_CLASS_DISPLAY_VGA) { |
1490 | err ("The device %x function %x is not supported for hot removing. " | 1487 | err ("The device %x function %x is not supported for hot removing. Please choose another device.\n", device, function); |
1491 | "Please choose another device.\n", device, function); | ||
1492 | return -ENODEV; | 1488 | return -ENODEV; |
1493 | } | 1489 | } |
1494 | 1490 | ||
@@ -1513,9 +1509,7 @@ static int unconfigure_boot_card (struct slot *slot_cur) | |||
1513 | case PCI_HEADER_TYPE_BRIDGE: | 1509 | case PCI_HEADER_TYPE_BRIDGE: |
1514 | class >>= 8; | 1510 | class >>= 8; |
1515 | if (class != PCI_CLASS_BRIDGE_PCI) { | 1511 | if (class != PCI_CLASS_BRIDGE_PCI) { |
1516 | err ("This device %x function %x is not PCI-to-PCI bridge, " | 1512 | err ("This device %x function %x is not PCI-to-PCI bridge, and is not supported for hot-removing. Please try another card.\n", device, function); |
1517 | "and is not supported for hot-removing. " | ||
1518 | "Please try another card.\n", device, function); | ||
1519 | return -ENODEV; | 1513 | return -ENODEV; |
1520 | } | 1514 | } |
1521 | rc = unconfigure_boot_bridge (busno, device, function); | 1515 | rc = unconfigure_boot_bridge (busno, device, function); |
@@ -1529,9 +1523,7 @@ static int unconfigure_boot_card (struct slot *slot_cur) | |||
1529 | case PCI_HEADER_TYPE_MULTIBRIDGE: | 1523 | case PCI_HEADER_TYPE_MULTIBRIDGE: |
1530 | class >>= 8; | 1524 | class >>= 8; |
1531 | if (class != PCI_CLASS_BRIDGE_PCI) { | 1525 | if (class != PCI_CLASS_BRIDGE_PCI) { |
1532 | err ("This device %x function %x is not PCI-to-PCI bridge, " | 1526 | err ("This device %x function %x is not PCI-to-PCI bridge, and is not supported for hot-removing. Please try another card.\n", device, function); |
1533 | "and is not supported for hot-removing. " | ||
1534 | "Please try another card.\n", device, function); | ||
1535 | return -ENODEV; | 1527 | return -ENODEV; |
1536 | } | 1528 | } |
1537 | rc = unconfigure_boot_bridge (busno, device, function); | 1529 | rc = unconfigure_boot_bridge (busno, device, function); |
diff --git a/drivers/pci/hotplug/ibmphp_res.c b/drivers/pci/hotplug/ibmphp_res.c index a265acb2d518..f34745abd5b6 100644 --- a/drivers/pci/hotplug/ibmphp_res.c +++ b/drivers/pci/hotplug/ibmphp_res.c | |||
@@ -46,9 +46,9 @@ static struct bus_node *find_bus_wprev (u8, struct bus_node **, u8); | |||
46 | 46 | ||
47 | static LIST_HEAD(gbuses); | 47 | static LIST_HEAD(gbuses); |
48 | 48 | ||
49 | static struct bus_node * __init alloc_error_bus (struct ebda_pci_rsrc * curr, u8 busno, int flag) | 49 | static struct bus_node * __init alloc_error_bus (struct ebda_pci_rsrc *curr, u8 busno, int flag) |
50 | { | 50 | { |
51 | struct bus_node * newbus; | 51 | struct bus_node *newbus; |
52 | 52 | ||
53 | if (!(curr) && !(flag)) { | 53 | if (!(curr) && !(flag)) { |
54 | err ("NULL pointer passed\n"); | 54 | err ("NULL pointer passed\n"); |
@@ -69,7 +69,7 @@ static struct bus_node * __init alloc_error_bus (struct ebda_pci_rsrc * curr, u8 | |||
69 | return newbus; | 69 | return newbus; |
70 | } | 70 | } |
71 | 71 | ||
72 | static struct resource_node * __init alloc_resources (struct ebda_pci_rsrc * curr) | 72 | static struct resource_node * __init alloc_resources (struct ebda_pci_rsrc *curr) |
73 | { | 73 | { |
74 | struct resource_node *rs; | 74 | struct resource_node *rs; |
75 | 75 | ||
@@ -93,7 +93,7 @@ static struct resource_node * __init alloc_resources (struct ebda_pci_rsrc * cur | |||
93 | 93 | ||
94 | static int __init alloc_bus_range (struct bus_node **new_bus, struct range_node **new_range, struct ebda_pci_rsrc *curr, int flag, u8 first_bus) | 94 | static int __init alloc_bus_range (struct bus_node **new_bus, struct range_node **new_range, struct ebda_pci_rsrc *curr, int flag, u8 first_bus) |
95 | { | 95 | { |
96 | struct bus_node * newbus; | 96 | struct bus_node *newbus; |
97 | struct range_node *newrange; | 97 | struct range_node *newrange; |
98 | u8 num_ranges = 0; | 98 | u8 num_ranges = 0; |
99 | 99 | ||
@@ -789,8 +789,7 @@ int ibmphp_remove_resource (struct resource_node *res) | |||
789 | bus_cur = find_bus_wprev (res->busno, NULL, 0); | 789 | bus_cur = find_bus_wprev (res->busno, NULL, 0); |
790 | 790 | ||
791 | if (!bus_cur) { | 791 | if (!bus_cur) { |
792 | err ("cannot find corresponding bus of the io resource to remove " | 792 | err ("cannot find corresponding bus of the io resource to remove bailing out...\n"); |
793 | "bailing out...\n"); | ||
794 | return -ENODEV; | 793 | return -ENODEV; |
795 | } | 794 | } |
796 | 795 | ||
@@ -934,9 +933,9 @@ int ibmphp_remove_resource (struct resource_node *res) | |||
934 | return 0; | 933 | return 0; |
935 | } | 934 | } |
936 | 935 | ||
937 | static struct range_node * find_range (struct bus_node *bus_cur, struct resource_node * res) | 936 | static struct range_node *find_range (struct bus_node *bus_cur, struct resource_node *res) |
938 | { | 937 | { |
939 | struct range_node * range = NULL; | 938 | struct range_node *range = NULL; |
940 | 939 | ||
941 | switch (res->type) { | 940 | switch (res->type) { |
942 | case IO: | 941 | case IO: |
diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c index cfa92a984e62..56d8486dc167 100644 --- a/drivers/pci/hotplug/pci_hotplug_core.c +++ b/drivers/pci/hotplug/pci_hotplug_core.c | |||
@@ -59,14 +59,12 @@ static bool debug; | |||
59 | #define DRIVER_DESC "PCI Hot Plug PCI Core" | 59 | #define DRIVER_DESC "PCI Hot Plug PCI Core" |
60 | 60 | ||
61 | 61 | ||
62 | ////////////////////////////////////////////////////////////////// | ||
63 | |||
64 | static LIST_HEAD(pci_hotplug_slot_list); | 62 | static LIST_HEAD(pci_hotplug_slot_list); |
65 | static DEFINE_MUTEX(pci_hp_mutex); | 63 | static DEFINE_MUTEX(pci_hp_mutex); |
66 | 64 | ||
67 | /* Weee, fun with macros... */ | 65 | /* Weee, fun with macros... */ |
68 | #define GET_STATUS(name,type) \ | 66 | #define GET_STATUS(name, type) \ |
69 | static int get_##name (struct hotplug_slot *slot, type *value) \ | 67 | static int get_##name(struct hotplug_slot *slot, type *value) \ |
70 | { \ | 68 | { \ |
71 | struct hotplug_slot_ops *ops = slot->ops; \ | 69 | struct hotplug_slot_ops *ops = slot->ops; \ |
72 | int retval = 0; \ | 70 | int retval = 0; \ |
@@ -92,42 +90,41 @@ static ssize_t power_read_file(struct pci_slot *slot, char *buf) | |||
92 | 90 | ||
93 | retval = get_power_status(slot->hotplug, &value); | 91 | retval = get_power_status(slot->hotplug, &value); |
94 | if (retval) | 92 | if (retval) |
95 | goto exit; | 93 | return retval; |
96 | retval = sprintf (buf, "%d\n", value); | 94 | |
97 | exit: | 95 | return sprintf(buf, "%d\n", value); |
98 | return retval; | ||
99 | } | 96 | } |
100 | 97 | ||
101 | static ssize_t power_write_file(struct pci_slot *pci_slot, const char *buf, | 98 | static ssize_t power_write_file(struct pci_slot *pci_slot, const char *buf, |
102 | size_t count) | 99 | size_t count) |
103 | { | 100 | { |
104 | struct hotplug_slot *slot = pci_slot->hotplug; | 101 | struct hotplug_slot *slot = pci_slot->hotplug; |
105 | unsigned long lpower; | 102 | unsigned long lpower; |
106 | u8 power; | 103 | u8 power; |
107 | int retval = 0; | 104 | int retval = 0; |
108 | 105 | ||
109 | lpower = simple_strtoul (buf, NULL, 10); | 106 | lpower = simple_strtoul(buf, NULL, 10); |
110 | power = (u8)(lpower & 0xff); | 107 | power = (u8)(lpower & 0xff); |
111 | dbg ("power = %d\n", power); | 108 | dbg("power = %d\n", power); |
112 | 109 | ||
113 | if (!try_module_get(slot->ops->owner)) { | 110 | if (!try_module_get(slot->ops->owner)) { |
114 | retval = -ENODEV; | 111 | retval = -ENODEV; |
115 | goto exit; | 112 | goto exit; |
116 | } | 113 | } |
117 | switch (power) { | 114 | switch (power) { |
118 | case 0: | 115 | case 0: |
119 | if (slot->ops->disable_slot) | 116 | if (slot->ops->disable_slot) |
120 | retval = slot->ops->disable_slot(slot); | 117 | retval = slot->ops->disable_slot(slot); |
121 | break; | 118 | break; |
122 | 119 | ||
123 | case 1: | 120 | case 1: |
124 | if (slot->ops->enable_slot) | 121 | if (slot->ops->enable_slot) |
125 | retval = slot->ops->enable_slot(slot); | 122 | retval = slot->ops->enable_slot(slot); |
126 | break; | 123 | break; |
127 | 124 | ||
128 | default: | 125 | default: |
129 | err ("Illegal value specified for power\n"); | 126 | err("Illegal value specified for power\n"); |
130 | retval = -EINVAL; | 127 | retval = -EINVAL; |
131 | } | 128 | } |
132 | module_put(slot->ops->owner); | 129 | module_put(slot->ops->owner); |
133 | 130 | ||
@@ -150,24 +147,22 @@ static ssize_t attention_read_file(struct pci_slot *slot, char *buf) | |||
150 | 147 | ||
151 | retval = get_attention_status(slot->hotplug, &value); | 148 | retval = get_attention_status(slot->hotplug, &value); |
152 | if (retval) | 149 | if (retval) |
153 | goto exit; | 150 | return retval; |
154 | retval = sprintf(buf, "%d\n", value); | ||
155 | 151 | ||
156 | exit: | 152 | return sprintf(buf, "%d\n", value); |
157 | return retval; | ||
158 | } | 153 | } |
159 | 154 | ||
160 | static ssize_t attention_write_file(struct pci_slot *slot, const char *buf, | 155 | static ssize_t attention_write_file(struct pci_slot *slot, const char *buf, |
161 | size_t count) | 156 | size_t count) |
162 | { | 157 | { |
163 | struct hotplug_slot_ops *ops = slot->hotplug->ops; | 158 | struct hotplug_slot_ops *ops = slot->hotplug->ops; |
164 | unsigned long lattention; | 159 | unsigned long lattention; |
165 | u8 attention; | 160 | u8 attention; |
166 | int retval = 0; | 161 | int retval = 0; |
167 | 162 | ||
168 | lattention = simple_strtoul (buf, NULL, 10); | 163 | lattention = simple_strtoul(buf, NULL, 10); |
169 | attention = (u8)(lattention & 0xff); | 164 | attention = (u8)(lattention & 0xff); |
170 | dbg (" - attention = %d\n", attention); | 165 | dbg(" - attention = %d\n", attention); |
171 | 166 | ||
172 | if (!try_module_get(ops->owner)) { | 167 | if (!try_module_get(ops->owner)) { |
173 | retval = -ENODEV; | 168 | retval = -ENODEV; |
@@ -196,11 +191,9 @@ static ssize_t latch_read_file(struct pci_slot *slot, char *buf) | |||
196 | 191 | ||
197 | retval = get_latch_status(slot->hotplug, &value); | 192 | retval = get_latch_status(slot->hotplug, &value); |
198 | if (retval) | 193 | if (retval) |
199 | goto exit; | 194 | return retval; |
200 | retval = sprintf (buf, "%d\n", value); | ||
201 | 195 | ||
202 | exit: | 196 | return sprintf(buf, "%d\n", value); |
203 | return retval; | ||
204 | } | 197 | } |
205 | 198 | ||
206 | static struct pci_slot_attribute hotplug_slot_attr_latch = { | 199 | static struct pci_slot_attribute hotplug_slot_attr_latch = { |
@@ -215,11 +208,9 @@ static ssize_t presence_read_file(struct pci_slot *slot, char *buf) | |||
215 | 208 | ||
216 | retval = get_adapter_status(slot->hotplug, &value); | 209 | retval = get_adapter_status(slot->hotplug, &value); |
217 | if (retval) | 210 | if (retval) |
218 | goto exit; | 211 | return retval; |
219 | retval = sprintf (buf, "%d\n", value); | ||
220 | 212 | ||
221 | exit: | 213 | return sprintf(buf, "%d\n", value); |
222 | return retval; | ||
223 | } | 214 | } |
224 | 215 | ||
225 | static struct pci_slot_attribute hotplug_slot_attr_presence = { | 216 | static struct pci_slot_attribute hotplug_slot_attr_presence = { |
@@ -228,7 +219,7 @@ static struct pci_slot_attribute hotplug_slot_attr_presence = { | |||
228 | }; | 219 | }; |
229 | 220 | ||
230 | static ssize_t test_write_file(struct pci_slot *pci_slot, const char *buf, | 221 | static ssize_t test_write_file(struct pci_slot *pci_slot, const char *buf, |
231 | size_t count) | 222 | size_t count) |
232 | { | 223 | { |
233 | struct hotplug_slot *slot = pci_slot->hotplug; | 224 | struct hotplug_slot *slot = pci_slot->hotplug; |
234 | unsigned long ltest; | 225 | unsigned long ltest; |
@@ -237,7 +228,7 @@ static ssize_t test_write_file(struct pci_slot *pci_slot, const char *buf, | |||
237 | 228 | ||
238 | ltest = simple_strtoul (buf, NULL, 10); | 229 | ltest = simple_strtoul (buf, NULL, 10); |
239 | test = (u32)(ltest & 0xffffffff); | 230 | test = (u32)(ltest & 0xffffffff); |
240 | dbg ("test = %d\n", test); | 231 | dbg("test = %d\n", test); |
241 | 232 | ||
242 | if (!try_module_get(slot->ops->owner)) { | 233 | if (!try_module_get(slot->ops->owner)) { |
243 | retval = -ENODEV; | 234 | retval = -ENODEV; |
@@ -261,6 +252,7 @@ static struct pci_slot_attribute hotplug_slot_attr_test = { | |||
261 | static bool has_power_file(struct pci_slot *pci_slot) | 252 | static bool has_power_file(struct pci_slot *pci_slot) |
262 | { | 253 | { |
263 | struct hotplug_slot *slot = pci_slot->hotplug; | 254 | struct hotplug_slot *slot = pci_slot->hotplug; |
255 | |||
264 | if ((!slot) || (!slot->ops)) | 256 | if ((!slot) || (!slot->ops)) |
265 | return false; | 257 | return false; |
266 | if ((slot->ops->enable_slot) || | 258 | if ((slot->ops->enable_slot) || |
@@ -273,6 +265,7 @@ static bool has_power_file(struct pci_slot *pci_slot) | |||
273 | static bool has_attention_file(struct pci_slot *pci_slot) | 265 | static bool has_attention_file(struct pci_slot *pci_slot) |
274 | { | 266 | { |
275 | struct hotplug_slot *slot = pci_slot->hotplug; | 267 | struct hotplug_slot *slot = pci_slot->hotplug; |
268 | |||
276 | if ((!slot) || (!slot->ops)) | 269 | if ((!slot) || (!slot->ops)) |
277 | return false; | 270 | return false; |
278 | if ((slot->ops->set_attention_status) || | 271 | if ((slot->ops->set_attention_status) || |
@@ -284,6 +277,7 @@ static bool has_attention_file(struct pci_slot *pci_slot) | |||
284 | static bool has_latch_file(struct pci_slot *pci_slot) | 277 | static bool has_latch_file(struct pci_slot *pci_slot) |
285 | { | 278 | { |
286 | struct hotplug_slot *slot = pci_slot->hotplug; | 279 | struct hotplug_slot *slot = pci_slot->hotplug; |
280 | |||
287 | if ((!slot) || (!slot->ops)) | 281 | if ((!slot) || (!slot->ops)) |
288 | return false; | 282 | return false; |
289 | if (slot->ops->get_latch_status) | 283 | if (slot->ops->get_latch_status) |
@@ -294,6 +288,7 @@ static bool has_latch_file(struct pci_slot *pci_slot) | |||
294 | static bool has_adapter_file(struct pci_slot *pci_slot) | 288 | static bool has_adapter_file(struct pci_slot *pci_slot) |
295 | { | 289 | { |
296 | struct hotplug_slot *slot = pci_slot->hotplug; | 290 | struct hotplug_slot *slot = pci_slot->hotplug; |
291 | |||
297 | if ((!slot) || (!slot->ops)) | 292 | if ((!slot) || (!slot->ops)) |
298 | return false; | 293 | return false; |
299 | if (slot->ops->get_adapter_status) | 294 | if (slot->ops->get_adapter_status) |
@@ -304,6 +299,7 @@ static bool has_adapter_file(struct pci_slot *pci_slot) | |||
304 | static bool has_test_file(struct pci_slot *pci_slot) | 299 | static bool has_test_file(struct pci_slot *pci_slot) |
305 | { | 300 | { |
306 | struct hotplug_slot *slot = pci_slot->hotplug; | 301 | struct hotplug_slot *slot = pci_slot->hotplug; |
302 | |||
307 | if ((!slot) || (!slot->ops)) | 303 | if ((!slot) || (!slot->ops)) |
308 | return false; | 304 | return false; |
309 | if (slot->ops->hardware_test) | 305 | if (slot->ops->hardware_test) |
@@ -397,13 +393,13 @@ static void fs_remove_slot(struct pci_slot *slot) | |||
397 | pci_hp_remove_module_link(slot); | 393 | pci_hp_remove_module_link(slot); |
398 | } | 394 | } |
399 | 395 | ||
400 | static struct hotplug_slot *get_slot_from_name (const char *name) | 396 | static struct hotplug_slot *get_slot_from_name(const char *name) |
401 | { | 397 | { |
402 | struct hotplug_slot *slot; | 398 | struct hotplug_slot *slot; |
403 | struct list_head *tmp; | 399 | struct list_head *tmp; |
404 | 400 | ||
405 | list_for_each (tmp, &pci_hotplug_slot_list) { | 401 | list_for_each(tmp, &pci_hotplug_slot_list) { |
406 | slot = list_entry (tmp, struct hotplug_slot, slot_list); | 402 | slot = list_entry(tmp, struct hotplug_slot, slot_list); |
407 | if (strcmp(hotplug_slot_name(slot), name) == 0) | 403 | if (strcmp(hotplug_slot_name(slot), name) == 0) |
408 | return slot; | 404 | return slot; |
409 | } | 405 | } |
@@ -436,8 +432,7 @@ int __pci_hp_register(struct hotplug_slot *slot, struct pci_bus *bus, | |||
436 | if ((slot->info == NULL) || (slot->ops == NULL)) | 432 | if ((slot->info == NULL) || (slot->ops == NULL)) |
437 | return -EINVAL; | 433 | return -EINVAL; |
438 | if (slot->release == NULL) { | 434 | if (slot->release == NULL) { |
439 | dbg("Why are you trying to register a hotplug slot " | 435 | dbg("Why are you trying to register a hotplug slot without a proper release function?\n"); |
440 | "without a proper release function?\n"); | ||
441 | return -EINVAL; | 436 | return -EINVAL; |
442 | } | 437 | } |
443 | 438 | ||
@@ -468,6 +463,7 @@ out: | |||
468 | mutex_unlock(&pci_hp_mutex); | 463 | mutex_unlock(&pci_hp_mutex); |
469 | return result; | 464 | return result; |
470 | } | 465 | } |
466 | EXPORT_SYMBOL_GPL(__pci_hp_register); | ||
471 | 467 | ||
472 | /** | 468 | /** |
473 | * pci_hp_deregister - deregister a hotplug_slot with the PCI hotplug subsystem | 469 | * pci_hp_deregister - deregister a hotplug_slot with the PCI hotplug subsystem |
@@ -506,6 +502,7 @@ int pci_hp_deregister(struct hotplug_slot *hotplug) | |||
506 | 502 | ||
507 | return 0; | 503 | return 0; |
508 | } | 504 | } |
505 | EXPORT_SYMBOL_GPL(pci_hp_deregister); | ||
509 | 506 | ||
510 | /** | 507 | /** |
511 | * pci_hp_change_slot_info - changes the slot's information structure in the core | 508 | * pci_hp_change_slot_info - changes the slot's information structure in the core |
@@ -527,24 +524,23 @@ int pci_hp_change_slot_info(struct hotplug_slot *hotplug, | |||
527 | 524 | ||
528 | return 0; | 525 | return 0; |
529 | } | 526 | } |
527 | EXPORT_SYMBOL_GPL(pci_hp_change_slot_info); | ||
530 | 528 | ||
531 | static int __init pci_hotplug_init (void) | 529 | static int __init pci_hotplug_init(void) |
532 | { | 530 | { |
533 | int result; | 531 | int result; |
534 | 532 | ||
535 | result = cpci_hotplug_init(debug); | 533 | result = cpci_hotplug_init(debug); |
536 | if (result) { | 534 | if (result) { |
537 | err ("cpci_hotplug_init with error %d\n", result); | 535 | err("cpci_hotplug_init with error %d\n", result); |
538 | goto err_cpci; | 536 | return result; |
539 | } | 537 | } |
540 | 538 | ||
541 | info (DRIVER_DESC " version: " DRIVER_VERSION "\n"); | 539 | info(DRIVER_DESC " version: " DRIVER_VERSION "\n"); |
542 | |||
543 | err_cpci: | ||
544 | return result; | 540 | return result; |
545 | } | 541 | } |
546 | 542 | ||
547 | static void __exit pci_hotplug_exit (void) | 543 | static void __exit pci_hotplug_exit(void) |
548 | { | 544 | { |
549 | cpci_hotplug_exit(); | 545 | cpci_hotplug_exit(); |
550 | } | 546 | } |
@@ -557,7 +553,3 @@ MODULE_DESCRIPTION(DRIVER_DESC); | |||
557 | MODULE_LICENSE("GPL"); | 553 | MODULE_LICENSE("GPL"); |
558 | module_param(debug, bool, 0644); | 554 | module_param(debug, bool, 0644); |
559 | MODULE_PARM_DESC(debug, "Debugging mode enabled or not"); | 555 | MODULE_PARM_DESC(debug, "Debugging mode enabled or not"); |
560 | |||
561 | EXPORT_SYMBOL_GPL(__pci_hp_register); | ||
562 | EXPORT_SYMBOL_GPL(pci_hp_deregister); | ||
563 | EXPORT_SYMBOL_GPL(pci_hp_change_slot_info); | ||
diff --git a/drivers/pci/hotplug/pciehp_acpi.c b/drivers/pci/hotplug/pciehp_acpi.c index 20fea57d2149..93cc9266e8cb 100644 --- a/drivers/pci/hotplug/pciehp_acpi.c +++ b/drivers/pci/hotplug/pciehp_acpi.c | |||
@@ -103,10 +103,10 @@ static int __init dummy_probe(struct pcie_device *dev) | |||
103 | } | 103 | } |
104 | 104 | ||
105 | static struct pcie_port_service_driver __initdata dummy_driver = { | 105 | static struct pcie_port_service_driver __initdata dummy_driver = { |
106 | .name = "pciehp_dummy", | 106 | .name = "pciehp_dummy", |
107 | .port_type = PCIE_ANY_PORT, | 107 | .port_type = PCIE_ANY_PORT, |
108 | .service = PCIE_PORT_SERVICE_HP, | 108 | .service = PCIE_PORT_SERVICE_HP, |
109 | .probe = dummy_probe, | 109 | .probe = dummy_probe, |
110 | }; | 110 | }; |
111 | 111 | ||
112 | static int __init select_detection_mode(void) | 112 | static int __init select_detection_mode(void) |
diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c index 0e0a2fff20a3..a2297db80813 100644 --- a/drivers/pci/hotplug/pciehp_core.c +++ b/drivers/pci/hotplug/pciehp_core.c | |||
@@ -266,8 +266,7 @@ static int pciehp_probe(struct pcie_device *dev) | |||
266 | rc = init_slot(ctrl); | 266 | rc = init_slot(ctrl); |
267 | if (rc) { | 267 | if (rc) { |
268 | if (rc == -EBUSY) | 268 | if (rc == -EBUSY) |
269 | ctrl_warn(ctrl, "Slot already registered by another " | 269 | ctrl_warn(ctrl, "Slot already registered by another hotplug driver\n"); |
270 | "hotplug driver\n"); | ||
271 | else | 270 | else |
272 | ctrl_err(ctrl, "Slot initialization failed\n"); | 271 | ctrl_err(ctrl, "Slot initialization failed\n"); |
273 | goto err_out_release_ctlr; | 272 | goto err_out_release_ctlr; |
@@ -312,12 +311,12 @@ static void pciehp_remove(struct pcie_device *dev) | |||
312 | } | 311 | } |
313 | 312 | ||
314 | #ifdef CONFIG_PM | 313 | #ifdef CONFIG_PM |
315 | static int pciehp_suspend (struct pcie_device *dev) | 314 | static int pciehp_suspend(struct pcie_device *dev) |
316 | { | 315 | { |
317 | return 0; | 316 | return 0; |
318 | } | 317 | } |
319 | 318 | ||
320 | static int pciehp_resume (struct pcie_device *dev) | 319 | static int pciehp_resume(struct pcie_device *dev) |
321 | { | 320 | { |
322 | struct controller *ctrl; | 321 | struct controller *ctrl; |
323 | struct slot *slot; | 322 | struct slot *slot; |
diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c index c75e6a678dcc..ff32e85e1de6 100644 --- a/drivers/pci/hotplug/pciehp_ctrl.c +++ b/drivers/pci/hotplug/pciehp_ctrl.c | |||
@@ -175,7 +175,7 @@ void pciehp_handle_linkstate_change(struct slot *p_slot) | |||
175 | hotplug controller logic | 175 | hotplug controller logic |
176 | */ | 176 | */ |
177 | 177 | ||
178 | static void set_slot_off(struct controller *ctrl, struct slot * pslot) | 178 | static void set_slot_off(struct controller *ctrl, struct slot *pslot) |
179 | { | 179 | { |
180 | /* turn off slot, turn on Amber LED, turn off Green LED if supported*/ | 180 | /* turn off slot, turn on Amber LED, turn off Green LED if supported*/ |
181 | if (POWER_CTRL(ctrl)) { | 181 | if (POWER_CTRL(ctrl)) { |
@@ -376,14 +376,12 @@ static void handle_button_press_event(struct slot *p_slot) | |||
376 | pciehp_get_power_status(p_slot, &getstatus); | 376 | pciehp_get_power_status(p_slot, &getstatus); |
377 | if (getstatus) { | 377 | if (getstatus) { |
378 | p_slot->state = BLINKINGOFF_STATE; | 378 | p_slot->state = BLINKINGOFF_STATE; |
379 | ctrl_info(ctrl, | 379 | ctrl_info(ctrl, "PCI slot #%s - powering off due to button press\n", |
380 | "PCI slot #%s - powering off due to button " | 380 | slot_name(p_slot)); |
381 | "press.\n", slot_name(p_slot)); | ||
382 | } else { | 381 | } else { |
383 | p_slot->state = BLINKINGON_STATE; | 382 | p_slot->state = BLINKINGON_STATE; |
384 | ctrl_info(ctrl, | 383 | ctrl_info(ctrl, "PCI slot #%s - powering on due to button press\n", |
385 | "PCI slot #%s - powering on due to button " | 384 | slot_name(p_slot)); |
386 | "press.\n", slot_name(p_slot)); | ||
387 | } | 385 | } |
388 | /* blink green LED and turn off amber */ | 386 | /* blink green LED and turn off amber */ |
389 | pciehp_green_led_blink(p_slot); | 387 | pciehp_green_led_blink(p_slot); |
@@ -404,8 +402,8 @@ static void handle_button_press_event(struct slot *p_slot) | |||
404 | else | 402 | else |
405 | pciehp_green_led_off(p_slot); | 403 | pciehp_green_led_off(p_slot); |
406 | pciehp_set_attention_status(p_slot, 0); | 404 | pciehp_set_attention_status(p_slot, 0); |
407 | ctrl_info(ctrl, "PCI slot #%s - action canceled " | 405 | ctrl_info(ctrl, "PCI slot #%s - action canceled due to button press\n", |
408 | "due to button press\n", slot_name(p_slot)); | 406 | slot_name(p_slot)); |
409 | p_slot->state = STATIC_STATE; | 407 | p_slot->state = STATIC_STATE; |
410 | break; | 408 | break; |
411 | case POWEROFF_STATE: | 409 | case POWEROFF_STATE: |
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 1463412cf7f8..42914e04d110 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c | |||
@@ -174,12 +174,10 @@ static void pcie_write_cmd(struct controller *ctrl, u16 cmd, u16 mask) | |||
174 | * event even though it supports none of power | 174 | * event even though it supports none of power |
175 | * controller, attention led, power led and EMI. | 175 | * controller, attention led, power led and EMI. |
176 | */ | 176 | */ |
177 | ctrl_dbg(ctrl, "Unexpected CMD_COMPLETED. Need to " | 177 | ctrl_dbg(ctrl, "Unexpected CMD_COMPLETED. Need to wait for command completed event\n"); |
178 | "wait for command completed event.\n"); | ||
179 | ctrl->no_cmd_complete = 0; | 178 | ctrl->no_cmd_complete = 0; |
180 | } else { | 179 | } else { |
181 | ctrl_dbg(ctrl, "Unexpected CMD_COMPLETED. Maybe " | 180 | ctrl_dbg(ctrl, "Unexpected CMD_COMPLETED. Maybe the controller is broken\n"); |
182 | "the controller is broken.\n"); | ||
183 | } | 181 | } |
184 | } | 182 | } |
185 | 183 | ||
@@ -203,7 +201,7 @@ static void pcie_write_cmd(struct controller *ctrl, u16 cmd, u16 mask) | |||
203 | if (!(slot_ctrl & PCI_EXP_SLTCTL_HPIE) || | 201 | if (!(slot_ctrl & PCI_EXP_SLTCTL_HPIE) || |
204 | !(slot_ctrl & PCI_EXP_SLTCTL_CCIE)) | 202 | !(slot_ctrl & PCI_EXP_SLTCTL_CCIE)) |
205 | poll = 1; | 203 | poll = 1; |
206 | pcie_wait_cmd(ctrl, poll); | 204 | pcie_wait_cmd(ctrl, poll); |
207 | } | 205 | } |
208 | mutex_unlock(&ctrl->ctrl_lock); | 206 | mutex_unlock(&ctrl->ctrl_lock); |
209 | } | 207 | } |
@@ -276,15 +274,15 @@ int pciehp_check_link_status(struct controller *ctrl) | |||
276 | bool found; | 274 | bool found; |
277 | u16 lnk_status; | 275 | u16 lnk_status; |
278 | 276 | ||
279 | /* | 277 | /* |
280 | * Data Link Layer Link Active Reporting must be capable for | 278 | * Data Link Layer Link Active Reporting must be capable for |
281 | * hot-plug capable downstream port. But old controller might | 279 | * hot-plug capable downstream port. But old controller might |
282 | * not implement it. In this case, we wait for 1000 ms. | 280 | * not implement it. In this case, we wait for 1000 ms. |
283 | */ | 281 | */ |
284 | if (ctrl->link_active_reporting) | 282 | if (ctrl->link_active_reporting) |
285 | pcie_wait_link_active(ctrl); | 283 | pcie_wait_link_active(ctrl); |
286 | else | 284 | else |
287 | msleep(1000); | 285 | msleep(1000); |
288 | 286 | ||
289 | /* wait 100ms before read pci conf, and try in 1s */ | 287 | /* wait 100ms before read pci conf, and try in 1s */ |
290 | msleep(100); | 288 | msleep(100); |
@@ -295,7 +293,7 @@ int pciehp_check_link_status(struct controller *ctrl) | |||
295 | ctrl_dbg(ctrl, "%s: lnk_status = %x\n", __func__, lnk_status); | 293 | ctrl_dbg(ctrl, "%s: lnk_status = %x\n", __func__, lnk_status); |
296 | if ((lnk_status & PCI_EXP_LNKSTA_LT) || | 294 | if ((lnk_status & PCI_EXP_LNKSTA_LT) || |
297 | !(lnk_status & PCI_EXP_LNKSTA_NLW)) { | 295 | !(lnk_status & PCI_EXP_LNKSTA_NLW)) { |
298 | ctrl_err(ctrl, "Link Training Error occurs \n"); | 296 | ctrl_err(ctrl, "Link Training Error occurs\n"); |
299 | return -1; | 297 | return -1; |
300 | } | 298 | } |
301 | 299 | ||
@@ -414,7 +412,7 @@ void pciehp_set_attention_status(struct slot *slot, u8 value) | |||
414 | return; | 412 | return; |
415 | 413 | ||
416 | switch (value) { | 414 | switch (value) { |
417 | case 0 : /* turn off */ | 415 | case 0: /* turn off */ |
418 | slot_cmd = PCI_EXP_SLTCTL_ATTN_IND_OFF; | 416 | slot_cmd = PCI_EXP_SLTCTL_ATTN_IND_OFF; |
419 | break; | 417 | break; |
420 | case 1: /* turn on */ | 418 | case 1: /* turn on */ |
@@ -470,7 +468,7 @@ void pciehp_green_led_blink(struct slot *slot) | |||
470 | PCI_EXP_SLTCTL_PWR_IND_BLINK); | 468 | PCI_EXP_SLTCTL_PWR_IND_BLINK); |
471 | } | 469 | } |
472 | 470 | ||
473 | int pciehp_power_on_slot(struct slot * slot) | 471 | int pciehp_power_on_slot(struct slot *slot) |
474 | { | 472 | { |
475 | struct controller *ctrl = slot->ctrl; | 473 | struct controller *ctrl = slot->ctrl; |
476 | struct pci_dev *pdev = ctrl_dev(ctrl); | 474 | struct pci_dev *pdev = ctrl_dev(ctrl); |
@@ -496,7 +494,7 @@ int pciehp_power_on_slot(struct slot * slot) | |||
496 | return retval; | 494 | return retval; |
497 | } | 495 | } |
498 | 496 | ||
499 | void pciehp_power_off_slot(struct slot * slot) | 497 | void pciehp_power_off_slot(struct slot *slot) |
500 | { | 498 | { |
501 | struct controller *ctrl = slot->ctrl; | 499 | struct controller *ctrl = slot->ctrl; |
502 | 500 | ||
@@ -756,7 +754,7 @@ static inline void dbg_ctrl(struct controller *ctrl) | |||
756 | ctrl_info(ctrl, "Slot Control : 0x%04x\n", reg16); | 754 | ctrl_info(ctrl, "Slot Control : 0x%04x\n", reg16); |
757 | } | 755 | } |
758 | 756 | ||
759 | #define FLAG(x,y) (((x) & (y)) ? '+' : '-') | 757 | #define FLAG(x, y) (((x) & (y)) ? '+' : '-') |
760 | 758 | ||
761 | struct controller *pcie_init(struct pcie_device *dev) | 759 | struct controller *pcie_init(struct pcie_device *dev) |
762 | { | 760 | { |
@@ -783,14 +781,14 @@ struct controller *pcie_init(struct pcie_device *dev) | |||
783 | */ | 781 | */ |
784 | if (NO_CMD_CMPL(ctrl) || | 782 | if (NO_CMD_CMPL(ctrl) || |
785 | !(POWER_CTRL(ctrl) | ATTN_LED(ctrl) | PWR_LED(ctrl) | EMI(ctrl))) | 783 | !(POWER_CTRL(ctrl) | ATTN_LED(ctrl) | PWR_LED(ctrl) | EMI(ctrl))) |
786 | ctrl->no_cmd_complete = 1; | 784 | ctrl->no_cmd_complete = 1; |
787 | 785 | ||
788 | /* Check if Data Link Layer Link Active Reporting is implemented */ | 786 | /* Check if Data Link Layer Link Active Reporting is implemented */ |
789 | pcie_capability_read_dword(pdev, PCI_EXP_LNKCAP, &link_cap); | 787 | pcie_capability_read_dword(pdev, PCI_EXP_LNKCAP, &link_cap); |
790 | if (link_cap & PCI_EXP_LNKCAP_DLLLARC) { | 788 | if (link_cap & PCI_EXP_LNKCAP_DLLLARC) { |
791 | ctrl_dbg(ctrl, "Link Active Reporting supported\n"); | 789 | ctrl_dbg(ctrl, "Link Active Reporting supported\n"); |
792 | ctrl->link_active_reporting = 1; | 790 | ctrl->link_active_reporting = 1; |
793 | } | 791 | } |
794 | 792 | ||
795 | /* Clear all remaining event bits in Slot Status register */ | 793 | /* Clear all remaining event bits in Slot Status register */ |
796 | pcie_capability_write_word(pdev, PCI_EXP_SLTSTA, | 794 | pcie_capability_write_word(pdev, PCI_EXP_SLTSTA, |
diff --git a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c index b6cb1df67097..5f871f4c4af1 100644 --- a/drivers/pci/hotplug/pciehp_pci.c +++ b/drivers/pci/hotplug/pciehp_pci.c | |||
@@ -46,9 +46,8 @@ int pciehp_configure_device(struct slot *p_slot) | |||
46 | 46 | ||
47 | dev = pci_get_slot(parent, PCI_DEVFN(0, 0)); | 47 | dev = pci_get_slot(parent, PCI_DEVFN(0, 0)); |
48 | if (dev) { | 48 | if (dev) { |
49 | ctrl_err(ctrl, "Device %s already exists " | 49 | ctrl_err(ctrl, "Device %s already exists at %04x:%02x:00, cannot hot-add\n", |
50 | "at %04x:%02x:00, cannot hot-add\n", pci_name(dev), | 50 | pci_name(dev), pci_domain_nr(parent), parent->number); |
51 | pci_domain_nr(parent), parent->number); | ||
52 | pci_dev_put(dev); | 51 | pci_dev_put(dev); |
53 | ret = -EEXIST; | 52 | ret = -EEXIST; |
54 | goto out; | 53 | goto out; |
diff --git a/drivers/pci/hotplug/pcihp_skeleton.c b/drivers/pci/hotplug/pcihp_skeleton.c index ac69094e4b20..d062c008fc95 100644 --- a/drivers/pci/hotplug/pcihp_skeleton.c +++ b/drivers/pci/hotplug/pcihp_skeleton.c | |||
@@ -51,7 +51,7 @@ static LIST_HEAD(slot_list); | |||
51 | #define dbg(format, arg...) \ | 51 | #define dbg(format, arg...) \ |
52 | do { \ | 52 | do { \ |
53 | if (debug) \ | 53 | if (debug) \ |
54 | printk (KERN_DEBUG "%s: " format "\n", \ | 54 | printk(KERN_DEBUG "%s: " format "\n", \ |
55 | MY_NAME , ## arg); \ | 55 | MY_NAME , ## arg); \ |
56 | } while (0) | 56 | } while (0) |
57 | #define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg) | 57 | #define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg) |
@@ -128,18 +128,18 @@ static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status) | |||
128 | dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name); | 128 | dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name); |
129 | 129 | ||
130 | switch (status) { | 130 | switch (status) { |
131 | case 0: | 131 | case 0: |
132 | /* | 132 | /* |
133 | * Fill in code here to turn light off | 133 | * Fill in code here to turn light off |
134 | */ | 134 | */ |
135 | break; | 135 | break; |
136 | 136 | ||
137 | case 1: | 137 | case 1: |
138 | default: | 138 | default: |
139 | /* | 139 | /* |
140 | * Fill in code here to turn light on | 140 | * Fill in code here to turn light on |
141 | */ | 141 | */ |
142 | break; | 142 | break; |
143 | } | 143 | } |
144 | 144 | ||
145 | return retval; | 145 | return retval; |
@@ -153,12 +153,12 @@ static int hardware_test(struct hotplug_slot *hotplug_slot, u32 value) | |||
153 | dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name); | 153 | dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name); |
154 | 154 | ||
155 | switch (value) { | 155 | switch (value) { |
156 | case 0: | 156 | case 0: |
157 | /* Specify a test here */ | 157 | /* Specify a test here */ |
158 | break; | 158 | break; |
159 | case 1: | 159 | case 1: |
160 | /* Specify another test here */ | 160 | /* Specify another test here */ |
161 | break; | 161 | break; |
162 | } | 162 | } |
163 | 163 | ||
164 | return retval; | 164 | return retval; |
diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c index 984d708552f6..93aa29f6d39c 100644 --- a/drivers/pci/hotplug/rpaphp_core.c +++ b/drivers/pci/hotplug/rpaphp_core.c | |||
@@ -39,6 +39,7 @@ | |||
39 | 39 | ||
40 | bool rpaphp_debug; | 40 | bool rpaphp_debug; |
41 | LIST_HEAD(rpaphp_slot_head); | 41 | LIST_HEAD(rpaphp_slot_head); |
42 | EXPORT_SYMBOL_GPL(rpaphp_slot_head); | ||
42 | 43 | ||
43 | #define DRIVER_VERSION "0.1" | 44 | #define DRIVER_VERSION "0.1" |
44 | #define DRIVER_AUTHOR "Linda Xie <lxie@us.ibm.com>" | 45 | #define DRIVER_AUTHOR "Linda Xie <lxie@us.ibm.com>" |
@@ -88,7 +89,7 @@ static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 value) | |||
88 | * @hotplug_slot: slot to get status | 89 | * @hotplug_slot: slot to get status |
89 | * @value: pointer to store status | 90 | * @value: pointer to store status |
90 | */ | 91 | */ |
91 | static int get_power_status(struct hotplug_slot *hotplug_slot, u8 * value) | 92 | static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value) |
92 | { | 93 | { |
93 | int retval, level; | 94 | int retval, level; |
94 | struct slot *slot = (struct slot *)hotplug_slot->private; | 95 | struct slot *slot = (struct slot *)hotplug_slot->private; |
@@ -104,14 +105,14 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 * value) | |||
104 | * @hotplug_slot: slot to get status | 105 | * @hotplug_slot: slot to get status |
105 | * @value: pointer to store status | 106 | * @value: pointer to store status |
106 | */ | 107 | */ |
107 | static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 * value) | 108 | static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value) |
108 | { | 109 | { |
109 | struct slot *slot = (struct slot *)hotplug_slot->private; | 110 | struct slot *slot = (struct slot *)hotplug_slot->private; |
110 | *value = slot->hotplug_slot->info->attention_status; | 111 | *value = slot->hotplug_slot->info->attention_status; |
111 | return 0; | 112 | return 0; |
112 | } | 113 | } |
113 | 114 | ||
114 | static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 * value) | 115 | static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value) |
115 | { | 116 | { |
116 | struct slot *slot = (struct slot *)hotplug_slot->private; | 117 | struct slot *slot = (struct slot *)hotplug_slot->private; |
117 | int rc, state; | 118 | int rc, state; |
@@ -241,6 +242,7 @@ int rpaphp_get_drc_props(struct device_node *dn, int *drc_index, | |||
241 | 242 | ||
242 | return -EINVAL; | 243 | return -EINVAL; |
243 | } | 244 | } |
245 | EXPORT_SYMBOL_GPL(rpaphp_get_drc_props); | ||
244 | 246 | ||
245 | static int is_php_type(char *drc_type) | 247 | static int is_php_type(char *drc_type) |
246 | { | 248 | { |
@@ -350,6 +352,7 @@ int rpaphp_add_slot(struct device_node *dn) | |||
350 | /* XXX FIXME: reports a failure only if last entry in loop failed */ | 352 | /* XXX FIXME: reports a failure only if last entry in loop failed */ |
351 | return retval; | 353 | return retval; |
352 | } | 354 | } |
355 | EXPORT_SYMBOL_GPL(rpaphp_add_slot); | ||
353 | 356 | ||
354 | static void __exit cleanup_slots(void) | 357 | static void __exit cleanup_slots(void) |
355 | { | 358 | { |
@@ -443,7 +446,3 @@ struct hotplug_slot_ops rpaphp_hotplug_slot_ops = { | |||
443 | 446 | ||
444 | module_init(rpaphp_init); | 447 | module_init(rpaphp_init); |
445 | module_exit(rpaphp_exit); | 448 | module_exit(rpaphp_exit); |
446 | |||
447 | EXPORT_SYMBOL_GPL(rpaphp_add_slot); | ||
448 | EXPORT_SYMBOL_GPL(rpaphp_slot_head); | ||
449 | EXPORT_SYMBOL_GPL(rpaphp_get_drc_props); | ||
diff --git a/drivers/pci/hotplug/sgi_hotplug.c b/drivers/pci/hotplug/sgi_hotplug.c index 613043f7576f..bada20999870 100644 --- a/drivers/pci/hotplug/sgi_hotplug.c +++ b/drivers/pci/hotplug/sgi_hotplug.c | |||
@@ -188,7 +188,7 @@ static int sn_hp_slot_private_alloc(struct hotplug_slot *bss_hotplug_slot, | |||
188 | return 0; | 188 | return 0; |
189 | } | 189 | } |
190 | 190 | ||
191 | static struct hotplug_slot * sn_hp_destroy(void) | 191 | static struct hotplug_slot *sn_hp_destroy(void) |
192 | { | 192 | { |
193 | struct slot *slot; | 193 | struct slot *slot; |
194 | struct pci_slot *pci_slot; | 194 | struct pci_slot *pci_slot; |
@@ -250,15 +250,13 @@ static int sn_slot_enable(struct hotplug_slot *bss_hotplug_slot, | |||
250 | } | 250 | } |
251 | 251 | ||
252 | if (rc == PCI_L1_ERR) { | 252 | if (rc == PCI_L1_ERR) { |
253 | dev_dbg(&slot->pci_bus->self->dev, | 253 | dev_dbg(&slot->pci_bus->self->dev, "L1 failure %d with message: %s", |
254 | "L1 failure %d with message: %s", | ||
255 | resp.resp_sub_errno, resp.resp_l1_msg); | 254 | resp.resp_sub_errno, resp.resp_l1_msg); |
256 | return -EPERM; | 255 | return -EPERM; |
257 | } | 256 | } |
258 | 257 | ||
259 | if (rc) { | 258 | if (rc) { |
260 | dev_dbg(&slot->pci_bus->self->dev, | 259 | dev_dbg(&slot->pci_bus->self->dev, "insert failed with error %d sub-error %d\n", |
261 | "insert failed with error %d sub-error %d\n", | ||
262 | rc, resp.resp_sub_errno); | 260 | rc, resp.resp_sub_errno); |
263 | return -EIO; | 261 | return -EIO; |
264 | } | 262 | } |
@@ -288,21 +286,18 @@ static int sn_slot_disable(struct hotplug_slot *bss_hotplug_slot, | |||
288 | } | 286 | } |
289 | 287 | ||
290 | if ((action == PCI_REQ_SLOT_ELIGIBLE) && (rc == PCI_EMPTY_33MHZ)) { | 288 | if ((action == PCI_REQ_SLOT_ELIGIBLE) && (rc == PCI_EMPTY_33MHZ)) { |
291 | dev_dbg(&slot->pci_bus->self->dev, | 289 | dev_dbg(&slot->pci_bus->self->dev, "Cannot remove last 33MHz card\n"); |
292 | "Cannot remove last 33MHz card\n"); | ||
293 | return -EPERM; | 290 | return -EPERM; |
294 | } | 291 | } |
295 | 292 | ||
296 | if ((action == PCI_REQ_SLOT_ELIGIBLE) && (rc == PCI_L1_ERR)) { | 293 | if ((action == PCI_REQ_SLOT_ELIGIBLE) && (rc == PCI_L1_ERR)) { |
297 | dev_dbg(&slot->pci_bus->self->dev, | 294 | dev_dbg(&slot->pci_bus->self->dev, "L1 failure %d with message \n%s\n", |
298 | "L1 failure %d with message \n%s\n", | ||
299 | resp.resp_sub_errno, resp.resp_l1_msg); | 295 | resp.resp_sub_errno, resp.resp_l1_msg); |
300 | return -EPERM; | 296 | return -EPERM; |
301 | } | 297 | } |
302 | 298 | ||
303 | if ((action == PCI_REQ_SLOT_ELIGIBLE) && rc) { | 299 | if ((action == PCI_REQ_SLOT_ELIGIBLE) && rc) { |
304 | dev_dbg(&slot->pci_bus->self->dev, | 300 | dev_dbg(&slot->pci_bus->self->dev, "remove failed with error %d sub-error %d\n", |
305 | "remove failed with error %d sub-error %d\n", | ||
306 | rc, resp.resp_sub_errno); | 301 | rc, resp.resp_sub_errno); |
307 | return -EIO; | 302 | return -EIO; |
308 | } | 303 | } |
@@ -417,8 +412,7 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot) | |||
417 | phandle = acpi_device_handle(PCI_CONTROLLER(slot->pci_bus)->companion); | 412 | phandle = acpi_device_handle(PCI_CONTROLLER(slot->pci_bus)->companion); |
418 | 413 | ||
419 | if (acpi_bus_get_device(phandle, &pdevice)) { | 414 | if (acpi_bus_get_device(phandle, &pdevice)) { |
420 | dev_dbg(&slot->pci_bus->self->dev, | 415 | dev_dbg(&slot->pci_bus->self->dev, "no parent device, assuming NULL\n"); |
421 | "no parent device, assuming NULL\n"); | ||
422 | pdevice = NULL; | 416 | pdevice = NULL; |
423 | } | 417 | } |
424 | 418 | ||
@@ -447,10 +441,8 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot) | |||
447 | 441 | ||
448 | ret = acpi_bus_scan(chandle); | 442 | ret = acpi_bus_scan(chandle); |
449 | if (ACPI_FAILURE(ret)) { | 443 | if (ACPI_FAILURE(ret)) { |
450 | printk(KERN_ERR "%s: acpi_bus_scan " | 444 | printk(KERN_ERR "%s: acpi_bus_scan failed (0x%x) for slot %d func %d\n", |
451 | "failed (0x%x) for slot %d " | 445 | __func__, ret, (int)(adr>>16), |
452 | "func %d\n", __func__, | ||
453 | ret, (int)(adr>>16), | ||
454 | (int)(adr&0xffff)); | 446 | (int)(adr&0xffff)); |
455 | /* try to continue on */ | 447 | /* try to continue on */ |
456 | } | 448 | } |
@@ -471,11 +463,9 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot) | |||
471 | mutex_unlock(&sn_hotplug_mutex); | 463 | mutex_unlock(&sn_hotplug_mutex); |
472 | 464 | ||
473 | if (rc == 0) | 465 | if (rc == 0) |
474 | dev_dbg(&slot->pci_bus->self->dev, | 466 | dev_dbg(&slot->pci_bus->self->dev, "insert operation successful\n"); |
475 | "insert operation successful\n"); | ||
476 | else | 467 | else |
477 | dev_dbg(&slot->pci_bus->self->dev, | 468 | dev_dbg(&slot->pci_bus->self->dev, "insert operation failed rc = %d\n", rc); |
478 | "insert operation failed rc = %d\n", rc); | ||
479 | 469 | ||
480 | return rc; | 470 | return rc; |
481 | } | 471 | } |
@@ -561,8 +551,7 @@ static int disable_slot(struct hotplug_slot *bss_hotplug_slot) | |||
561 | acpi_status ret; | 551 | acpi_status ret; |
562 | ret = acpi_unload_table_id(ssdt_id); | 552 | ret = acpi_unload_table_id(ssdt_id); |
563 | if (ACPI_FAILURE(ret)) { | 553 | if (ACPI_FAILURE(ret)) { |
564 | printk(KERN_ERR "%s: acpi_unload_table_id " | 554 | printk(KERN_ERR "%s: acpi_unload_table_id failed (0x%x) for id %d\n", |
565 | "failed (0x%x) for id %d\n", | ||
566 | __func__, ret, ssdt_id); | 555 | __func__, ret, ssdt_id); |
567 | /* try to continue on */ | 556 | /* try to continue on */ |
568 | } | 557 | } |
diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h index 61529097464d..5897d516427b 100644 --- a/drivers/pci/hotplug/shpchp.h +++ b/drivers/pci/hotplug/shpchp.h | |||
@@ -180,7 +180,7 @@ int shpchp_configure_device(struct slot *p_slot); | |||
180 | int shpchp_unconfigure_device(struct slot *p_slot); | 180 | int shpchp_unconfigure_device(struct slot *p_slot); |
181 | void cleanup_slots(struct controller *ctrl); | 181 | void cleanup_slots(struct controller *ctrl); |
182 | void shpchp_queue_pushbutton_work(struct work_struct *work); | 182 | void shpchp_queue_pushbutton_work(struct work_struct *work); |
183 | 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 | { |
@@ -295,7 +295,7 @@ static inline void amd_pogo_errata_restore_misc_reg(struct slot *p_slot) | |||
295 | pci_write_config_dword(p_slot->ctrl->pci_dev, PCIX_MEM_BASE_LIMIT_OFFSET, rse_set); | 295 | pci_write_config_dword(p_slot->ctrl->pci_dev, PCIX_MEM_BASE_LIMIT_OFFSET, rse_set); |
296 | } | 296 | } |
297 | /* restore MiscII register */ | 297 | /* restore MiscII register */ |
298 | pci_read_config_dword( p_slot->ctrl->pci_dev, PCIX_MISCII_OFFSET, &pcix_misc2_temp ); | 298 | pci_read_config_dword(p_slot->ctrl->pci_dev, PCIX_MISCII_OFFSET, &pcix_misc2_temp ); |
299 | 299 | ||
300 | if (p_slot->ctrl->pcix_misc2_reg & SERRFATALENABLE_MASK) | 300 | if (p_slot->ctrl->pcix_misc2_reg & SERRFATALENABLE_MASK) |
301 | pcix_misc2_temp |= SERRFATALENABLE_MASK; | 301 | pcix_misc2_temp |= SERRFATALENABLE_MASK; |
diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c index faf13abd5b99..294ef4b10cf1 100644 --- a/drivers/pci/hotplug/shpchp_core.c +++ b/drivers/pci/hotplug/shpchp_core.c | |||
@@ -143,8 +143,7 @@ static int init_slots(struct controller *ctrl) | |||
143 | snprintf(name, SLOT_NAME_SIZE, "%d", slot->number); | 143 | snprintf(name, SLOT_NAME_SIZE, "%d", slot->number); |
144 | hotplug_slot->ops = &shpchp_hotplug_slot_ops; | 144 | hotplug_slot->ops = &shpchp_hotplug_slot_ops; |
145 | 145 | ||
146 | ctrl_dbg(ctrl, "Registering domain:bus:dev=%04x:%02x:%02x " | 146 | ctrl_dbg(ctrl, "Registering domain:bus:dev=%04x:%02x:%02x hp_slot=%x sun=%x slot_device_offset=%x\n", |
147 | "hp_slot=%x sun=%x slot_device_offset=%x\n", | ||
148 | pci_domain_nr(ctrl->pci_dev->subordinate), | 147 | pci_domain_nr(ctrl->pci_dev->subordinate), |
149 | slot->bus, slot->device, slot->hp_slot, slot->number, | 148 | slot->bus, slot->device, slot->hp_slot, slot->number, |
150 | ctrl->slot_device_offset); | 149 | ctrl->slot_device_offset); |
diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c index 58499277903a..e57972366c91 100644 --- a/drivers/pci/hotplug/shpchp_ctrl.c +++ b/drivers/pci/hotplug/shpchp_ctrl.c | |||
@@ -162,7 +162,7 @@ u8 shpchp_handle_power_fault(u8 hp_slot, struct controller *ctrl) | |||
162 | 162 | ||
163 | p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); | 163 | p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); |
164 | 164 | ||
165 | if ( !(p_slot->hpc_ops->query_power_fault(p_slot))) { | 165 | if (!(p_slot->hpc_ops->query_power_fault(p_slot))) { |
166 | /* | 166 | /* |
167 | * Power fault Cleared | 167 | * Power fault Cleared |
168 | */ | 168 | */ |
@@ -196,8 +196,8 @@ static int change_bus_speed(struct controller *ctrl, struct slot *p_slot, | |||
196 | 196 | ||
197 | ctrl_dbg(ctrl, "Change speed to %d\n", speed); | 197 | ctrl_dbg(ctrl, "Change speed to %d\n", speed); |
198 | if ((rc = p_slot->hpc_ops->set_bus_speed_mode(p_slot, speed))) { | 198 | if ((rc = p_slot->hpc_ops->set_bus_speed_mode(p_slot, speed))) { |
199 | ctrl_err(ctrl, "%s: Issue of set bus speed mode command " | 199 | ctrl_err(ctrl, "%s: Issue of set bus speed mode command failed\n", |
200 | "failed\n", __func__); | 200 | __func__); |
201 | return WRONG_BUS_FREQUENCY; | 201 | return WRONG_BUS_FREQUENCY; |
202 | } | 202 | } |
203 | return rc; | 203 | return rc; |
@@ -215,8 +215,8 @@ static int fix_bus_speed(struct controller *ctrl, struct slot *pslot, | |||
215 | */ | 215 | */ |
216 | if (flag) { | 216 | if (flag) { |
217 | if (asp < bsp) { | 217 | if (asp < bsp) { |
218 | ctrl_err(ctrl, "Speed of bus %x and adapter %x " | 218 | ctrl_err(ctrl, "Speed of bus %x and adapter %x mismatch\n", |
219 | "mismatch\n", bsp, asp); | 219 | bsp, asp); |
220 | rc = WRONG_BUS_FREQUENCY; | 220 | rc = WRONG_BUS_FREQUENCY; |
221 | } | 221 | } |
222 | return rc; | 222 | return rc; |
@@ -250,8 +250,7 @@ static int board_added(struct slot *p_slot) | |||
250 | 250 | ||
251 | hp_slot = p_slot->device - ctrl->slot_device_offset; | 251 | hp_slot = p_slot->device - ctrl->slot_device_offset; |
252 | 252 | ||
253 | ctrl_dbg(ctrl, | 253 | ctrl_dbg(ctrl, "%s: p_slot->device, slot_offset, hp_slot = %d, %d ,%d\n", |
254 | "%s: p_slot->device, slot_offset, hp_slot = %d, %d ,%d\n", | ||
255 | __func__, p_slot->device, ctrl->slot_device_offset, hp_slot); | 254 | __func__, p_slot->device, ctrl->slot_device_offset, hp_slot); |
256 | 255 | ||
257 | /* Power on slot without connecting to bus */ | 256 | /* Power on slot without connecting to bus */ |
@@ -263,8 +262,8 @@ static int board_added(struct slot *p_slot) | |||
263 | 262 | ||
264 | if ((ctrl->pci_dev->vendor == 0x8086) && (ctrl->pci_dev->device == 0x0332)) { | 263 | if ((ctrl->pci_dev->vendor == 0x8086) && (ctrl->pci_dev->device == 0x0332)) { |
265 | if ((rc = p_slot->hpc_ops->set_bus_speed_mode(p_slot, PCI_SPEED_33MHz))) { | 264 | if ((rc = p_slot->hpc_ops->set_bus_speed_mode(p_slot, PCI_SPEED_33MHz))) { |
266 | ctrl_err(ctrl, "%s: Issue of set bus speed mode command" | 265 | ctrl_err(ctrl, "%s: Issue of set bus speed mode command failed\n", |
267 | " failed\n", __func__); | 266 | __func__); |
268 | return WRONG_BUS_FREQUENCY; | 267 | return WRONG_BUS_FREQUENCY; |
269 | } | 268 | } |
270 | 269 | ||
@@ -277,8 +276,7 @@ static int board_added(struct slot *p_slot) | |||
277 | 276 | ||
278 | rc = p_slot->hpc_ops->get_adapter_speed(p_slot, &asp); | 277 | rc = p_slot->hpc_ops->get_adapter_speed(p_slot, &asp); |
279 | if (rc) { | 278 | if (rc) { |
280 | ctrl_err(ctrl, "Can't get adapter speed or " | 279 | ctrl_err(ctrl, "Can't get adapter speed or bus mode mismatch\n"); |
281 | "bus mode mismatch\n"); | ||
282 | return WRONG_BUS_FREQUENCY; | 280 | return WRONG_BUS_FREQUENCY; |
283 | } | 281 | } |
284 | 282 | ||
@@ -289,8 +287,8 @@ static int board_added(struct slot *p_slot) | |||
289 | if (!list_empty(&ctrl->pci_dev->subordinate->devices)) | 287 | if (!list_empty(&ctrl->pci_dev->subordinate->devices)) |
290 | slots_not_empty = 1; | 288 | slots_not_empty = 1; |
291 | 289 | ||
292 | ctrl_dbg(ctrl, "%s: slots_not_empty %d, adapter_speed %d, bus_speed %d," | 290 | ctrl_dbg(ctrl, "%s: slots_not_empty %d, adapter_speed %d, bus_speed %d, max_bus_speed %d\n", |
293 | " max_bus_speed %d\n", __func__, slots_not_empty, asp, | 291 | __func__, slots_not_empty, asp, |
294 | bsp, msp); | 292 | bsp, msp); |
295 | 293 | ||
296 | rc = fix_bus_speed(ctrl, p_slot, slots_not_empty, asp, bsp, msp); | 294 | rc = fix_bus_speed(ctrl, p_slot, slots_not_empty, asp, bsp, msp); |
@@ -490,12 +488,12 @@ static void handle_button_press_event(struct slot *p_slot) | |||
490 | p_slot->hpc_ops->get_power_status(p_slot, &getstatus); | 488 | p_slot->hpc_ops->get_power_status(p_slot, &getstatus); |
491 | if (getstatus) { | 489 | if (getstatus) { |
492 | p_slot->state = BLINKINGOFF_STATE; | 490 | p_slot->state = BLINKINGOFF_STATE; |
493 | ctrl_info(ctrl, "PCI slot #%s - powering off due to " | 491 | ctrl_info(ctrl, "PCI slot #%s - powering off due to button press\n", |
494 | "button press.\n", slot_name(p_slot)); | 492 | slot_name(p_slot)); |
495 | } else { | 493 | } else { |
496 | p_slot->state = BLINKINGON_STATE; | 494 | p_slot->state = BLINKINGON_STATE; |
497 | ctrl_info(ctrl, "PCI slot #%s - powering on due to " | 495 | ctrl_info(ctrl, "PCI slot #%s - powering on due to button press\n", |
498 | "button press.\n", slot_name(p_slot)); | 496 | slot_name(p_slot)); |
499 | } | 497 | } |
500 | /* blink green LED and turn off amber */ | 498 | /* blink green LED and turn off amber */ |
501 | p_slot->hpc_ops->green_led_blink(p_slot); | 499 | p_slot->hpc_ops->green_led_blink(p_slot); |
@@ -518,8 +516,8 @@ static void handle_button_press_event(struct slot *p_slot) | |||
518 | else | 516 | else |
519 | p_slot->hpc_ops->green_led_off(p_slot); | 517 | p_slot->hpc_ops->green_led_off(p_slot); |
520 | p_slot->hpc_ops->set_attention_status(p_slot, 0); | 518 | p_slot->hpc_ops->set_attention_status(p_slot, 0); |
521 | ctrl_info(ctrl, "PCI slot #%s - action canceled due to " | 519 | ctrl_info(ctrl, "PCI slot #%s - action canceled due to button press\n", |
522 | "button press\n", slot_name(p_slot)); | 520 | slot_name(p_slot)); |
523 | p_slot->state = STATIC_STATE; | 521 | p_slot->state = STATIC_STATE; |
524 | break; | 522 | break; |
525 | case POWEROFF_STATE: | 523 | case POWEROFF_STATE: |
diff --git a/drivers/pci/hotplug/shpchp_hpc.c b/drivers/pci/hotplug/shpchp_hpc.c index 2d7f474ca0ec..29e22352822c 100644 --- a/drivers/pci/hotplug/shpchp_hpc.c +++ b/drivers/pci/hotplug/shpchp_hpc.c | |||
@@ -341,8 +341,7 @@ static int shpc_write_cmd(struct slot *slot, u8 t_slot, u8 cmd) | |||
341 | 341 | ||
342 | cmd_status = hpc_check_cmd_status(slot->ctrl); | 342 | cmd_status = hpc_check_cmd_status(slot->ctrl); |
343 | if (cmd_status) { | 343 | if (cmd_status) { |
344 | ctrl_err(ctrl, | 344 | ctrl_err(ctrl, "Failed to issued command 0x%x (error code = %d)\n", |
345 | "Failed to issued command 0x%x (error code = %d)\n", | ||
346 | cmd, cmd_status); | 345 | cmd, cmd_status); |
347 | retval = -EIO; | 346 | retval = -EIO; |
348 | } | 347 | } |
@@ -404,7 +403,7 @@ static int hpc_get_attention_status(struct slot *slot, u8 *status) | |||
404 | return 0; | 403 | return 0; |
405 | } | 404 | } |
406 | 405 | ||
407 | static int hpc_get_power_status(struct slot * slot, u8 *status) | 406 | static int hpc_get_power_status(struct slot *slot, u8 *status) |
408 | { | 407 | { |
409 | struct controller *ctrl = slot->ctrl; | 408 | struct controller *ctrl = slot->ctrl; |
410 | u32 slot_reg = shpc_readl(ctrl, SLOT_REG(slot->hp_slot)); | 409 | u32 slot_reg = shpc_readl(ctrl, SLOT_REG(slot->hp_slot)); |
@@ -528,7 +527,7 @@ static int hpc_get_mode1_ECC_cap(struct slot *slot, u8 *mode) | |||
528 | return retval; | 527 | return retval; |
529 | } | 528 | } |
530 | 529 | ||
531 | static int hpc_query_power_fault(struct slot * slot) | 530 | static int hpc_query_power_fault(struct slot *slot) |
532 | { | 531 | { |
533 | struct controller *ctrl = slot->ctrl; | 532 | struct controller *ctrl = slot->ctrl; |
534 | u32 slot_reg = shpc_readl(ctrl, SLOT_REG(slot->hp_slot)); | 533 | u32 slot_reg = shpc_readl(ctrl, SLOT_REG(slot->hp_slot)); |
@@ -614,7 +613,7 @@ static void hpc_release_ctlr(struct controller *ctrl) | |||
614 | release_mem_region(ctrl->mmio_base, ctrl->mmio_size); | 613 | release_mem_region(ctrl->mmio_base, ctrl->mmio_size); |
615 | } | 614 | } |
616 | 615 | ||
617 | static int hpc_power_on_slot(struct slot * slot) | 616 | static int hpc_power_on_slot(struct slot *slot) |
618 | { | 617 | { |
619 | int retval; | 618 | int retval; |
620 | 619 | ||
@@ -625,7 +624,7 @@ static int hpc_power_on_slot(struct slot * slot) | |||
625 | return retval; | 624 | return retval; |
626 | } | 625 | } |
627 | 626 | ||
628 | static int hpc_slot_enable(struct slot * slot) | 627 | static int hpc_slot_enable(struct slot *slot) |
629 | { | 628 | { |
630 | int retval; | 629 | int retval; |
631 | 630 | ||
@@ -638,7 +637,7 @@ static int hpc_slot_enable(struct slot * slot) | |||
638 | return retval; | 637 | return retval; |
639 | } | 638 | } |
640 | 639 | ||
641 | static int hpc_slot_disable(struct slot * slot) | 640 | static int hpc_slot_disable(struct slot *slot) |
642 | { | 641 | { |
643 | int retval; | 642 | int retval; |
644 | 643 | ||
@@ -720,7 +719,7 @@ static int shpc_get_cur_bus_speed(struct controller *ctrl) | |||
720 | } | 719 | } |
721 | 720 | ||
722 | 721 | ||
723 | static int hpc_set_bus_speed_mode(struct slot * slot, enum pci_bus_speed value) | 722 | static int hpc_set_bus_speed_mode(struct slot *slot, enum pci_bus_speed value) |
724 | { | 723 | { |
725 | int retval; | 724 | int retval; |
726 | struct controller *ctrl = slot->ctrl; | 725 | struct controller *ctrl = slot->ctrl; |
@@ -974,8 +973,8 @@ int shpc_init(struct controller *ctrl, struct pci_dev *pdev) | |||
974 | for (i = 0; i < 9 + num_slots; i++) { | 973 | for (i = 0; i < 9 + num_slots; i++) { |
975 | rc = shpc_indirect_read(ctrl, i, &tempdword); | 974 | rc = shpc_indirect_read(ctrl, i, &tempdword); |
976 | if (rc) { | 975 | if (rc) { |
977 | ctrl_err(ctrl, | 976 | ctrl_err(ctrl, "Cannot read creg (index = %d)\n", |
978 | "Cannot read creg (index = %d)\n", i); | 977 | i); |
979 | goto abort; | 978 | goto abort; |
980 | } | 979 | } |
981 | ctrl_dbg(ctrl, " offset %d: value %x\n", i, tempdword); | 980 | ctrl_dbg(ctrl, " offset %d: value %x\n", i, tempdword); |
@@ -1060,10 +1059,8 @@ int shpc_init(struct controller *ctrl, struct pci_dev *pdev) | |||
1060 | /* Installs the interrupt handler */ | 1059 | /* Installs the interrupt handler */ |
1061 | rc = pci_enable_msi(pdev); | 1060 | rc = pci_enable_msi(pdev); |
1062 | if (rc) { | 1061 | if (rc) { |
1063 | ctrl_info(ctrl, | 1062 | ctrl_info(ctrl, "Can't get msi for the hotplug controller\n"); |
1064 | "Can't get msi for the hotplug controller\n"); | 1063 | ctrl_info(ctrl, "Use INTx for the hotplug controller\n"); |
1065 | ctrl_info(ctrl, | ||
1066 | "Use INTx for the hotplug controller\n"); | ||
1067 | } | 1064 | } |
1068 | 1065 | ||
1069 | rc = request_irq(ctrl->pci_dev->irq, shpc_isr, IRQF_SHARED, | 1066 | rc = request_irq(ctrl->pci_dev->irq, shpc_isr, IRQF_SHARED, |
@@ -1071,8 +1068,8 @@ int shpc_init(struct controller *ctrl, struct pci_dev *pdev) | |||
1071 | ctrl_dbg(ctrl, "request_irq %d (returns %d)\n", | 1068 | ctrl_dbg(ctrl, "request_irq %d (returns %d)\n", |
1072 | ctrl->pci_dev->irq, rc); | 1069 | ctrl->pci_dev->irq, rc); |
1073 | if (rc) { | 1070 | if (rc) { |
1074 | ctrl_err(ctrl, "Can't get irq %d for the hotplug " | 1071 | ctrl_err(ctrl, "Can't get irq %d for the hotplug controller\n", |
1075 | "controller\n", ctrl->pci_dev->irq); | 1072 | ctrl->pci_dev->irq); |
1076 | goto abort_iounmap; | 1073 | goto abort_iounmap; |
1077 | } | 1074 | } |
1078 | } | 1075 | } |
diff --git a/drivers/pci/hotplug/shpchp_pci.c b/drivers/pci/hotplug/shpchp_pci.c index 9202d133485c..469454e0cc48 100644 --- a/drivers/pci/hotplug/shpchp_pci.c +++ b/drivers/pci/hotplug/shpchp_pci.c | |||
@@ -46,9 +46,9 @@ int shpchp_configure_device(struct slot *p_slot) | |||
46 | 46 | ||
47 | dev = pci_get_slot(parent, PCI_DEVFN(p_slot->device, 0)); | 47 | dev = pci_get_slot(parent, PCI_DEVFN(p_slot->device, 0)); |
48 | if (dev) { | 48 | if (dev) { |
49 | ctrl_err(ctrl, "Device %s already exists " | 49 | ctrl_err(ctrl, "Device %s already exists at %04x:%02x:%02x, cannot hot-add\n", |
50 | "at %04x:%02x:%02x, cannot hot-add\n", pci_name(dev), | 50 | pci_name(dev), pci_domain_nr(parent), |
51 | pci_domain_nr(parent), p_slot->bus, p_slot->device); | 51 | p_slot->bus, p_slot->device); |
52 | pci_dev_put(dev); | 52 | pci_dev_put(dev); |
53 | ret = -EINVAL; | 53 | ret = -EINVAL; |
54 | goto out; | 54 | goto out; |
diff --git a/drivers/pci/hotplug/shpchp_sysfs.c b/drivers/pci/hotplug/shpchp_sysfs.c index e8c31fe20566..52875b360463 100644 --- a/drivers/pci/hotplug/shpchp_sysfs.c +++ b/drivers/pci/hotplug/shpchp_sysfs.c | |||
@@ -38,7 +38,7 @@ | |||
38 | static ssize_t show_ctrl (struct device *dev, struct device_attribute *attr, char *buf) | 38 | static ssize_t show_ctrl (struct device *dev, struct device_attribute *attr, char *buf) |
39 | { | 39 | { |
40 | struct pci_dev *pdev; | 40 | struct pci_dev *pdev; |
41 | char * out = buf; | 41 | char *out = buf; |
42 | int index, busnr; | 42 | int index, busnr; |
43 | struct resource *res; | 43 | struct resource *res; |
44 | struct pci_bus *bus; | 44 | struct pci_bus *bus; |