aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/shpchp_ctrl.c
diff options
context:
space:
mode:
authorTaku Izumi <izumi.taku@jp.fujitsu.com>2008-10-22 22:52:12 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-10-23 19:11:50 -0400
commitf98ca311f3a32e2adc229fecd6bf732db07fcca3 (patch)
tree70605c5063f72f93a08d350b0fcb66fd359b7996 /drivers/pci/hotplug/shpchp_ctrl.c
parent388c8c16abafc2e74dff173b5de9ee519ea8d32f (diff)
PCI hotplug: shpchp: replace printk with dev_printk
This patch replaces printks within shpchp module with dev_printks. Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/hotplug/shpchp_ctrl.c')
-rw-r--r--drivers/pci/hotplug/shpchp_ctrl.c162
1 files changed, 93 insertions, 69 deletions
diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c
index 919b1ee44313..c9049f17864e 100644
--- a/drivers/pci/hotplug/shpchp_ctrl.c
+++ b/drivers/pci/hotplug/shpchp_ctrl.c
@@ -62,7 +62,7 @@ u8 shpchp_handle_attention_button(u8 hp_slot, struct controller *ctrl)
62 u32 event_type; 62 u32 event_type;
63 63
64 /* Attention Button Change */ 64 /* Attention Button Change */
65 dbg("shpchp: Attention button interrupt received.\n"); 65 ctrl_dbg(ctrl, "Attention button interrupt received.\n");
66 66
67 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); 67 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset);
68 p_slot->hpc_ops->get_adapter_status(p_slot, &(p_slot->presence_save)); 68 p_slot->hpc_ops->get_adapter_status(p_slot, &(p_slot->presence_save));
@@ -70,7 +70,7 @@ u8 shpchp_handle_attention_button(u8 hp_slot, struct controller *ctrl)
70 /* 70 /*
71 * Button pressed - See if need to TAKE ACTION!!! 71 * Button pressed - See if need to TAKE ACTION!!!
72 */ 72 */
73 info("Button pressed on Slot(%s)\n", slot_name(p_slot)); 73 ctrl_info(ctrl, "Button pressed on Slot(%s)\n", slot_name(p_slot));
74 event_type = INT_BUTTON_PRESS; 74 event_type = INT_BUTTON_PRESS;
75 75
76 queue_interrupt_event(p_slot, event_type); 76 queue_interrupt_event(p_slot, event_type);
@@ -86,29 +86,29 @@ u8 shpchp_handle_switch_change(u8 hp_slot, struct controller *ctrl)
86 u32 event_type; 86 u32 event_type;
87 87
88 /* Switch Change */ 88 /* Switch Change */
89 dbg("shpchp: Switch interrupt received.\n"); 89 ctrl_dbg(ctrl, "Switch interrupt received.\n");
90 90
91 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); 91 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset);
92 p_slot->hpc_ops->get_adapter_status(p_slot, &(p_slot->presence_save)); 92 p_slot->hpc_ops->get_adapter_status(p_slot, &(p_slot->presence_save));
93 p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); 93 p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
94 dbg("%s: Card present %x Power status %x\n", __func__, 94 ctrl_dbg(ctrl, "%s: Card present %x Power status %x\n",
95 p_slot->presence_save, p_slot->pwr_save); 95 __func__, p_slot->presence_save, p_slot->pwr_save);
96 96
97 if (getstatus) { 97 if (getstatus) {
98 /* 98 /*
99 * Switch opened 99 * Switch opened
100 */ 100 */
101 info("Latch open on Slot(%s)\n", slot_name(p_slot)); 101 ctrl_info(ctrl, "Latch open on Slot(%s)\n", slot_name(p_slot));
102 event_type = INT_SWITCH_OPEN; 102 event_type = INT_SWITCH_OPEN;
103 if (p_slot->pwr_save && p_slot->presence_save) { 103 if (p_slot->pwr_save && p_slot->presence_save) {
104 event_type = INT_POWER_FAULT; 104 event_type = INT_POWER_FAULT;
105 err("Surprise Removal of card\n"); 105 ctrl_err(ctrl, "Surprise Removal of card\n");
106 } 106 }
107 } else { 107 } else {
108 /* 108 /*
109 * Switch closed 109 * Switch closed
110 */ 110 */
111 info("Latch close on Slot(%s)\n", slot_name(p_slot)); 111 ctrl_info(ctrl, "Latch close on Slot(%s)\n", slot_name(p_slot));
112 event_type = INT_SWITCH_CLOSE; 112 event_type = INT_SWITCH_CLOSE;
113 } 113 }
114 114
@@ -123,7 +123,7 @@ u8 shpchp_handle_presence_change(u8 hp_slot, struct controller *ctrl)
123 u32 event_type; 123 u32 event_type;
124 124
125 /* Presence Change */ 125 /* Presence Change */
126 dbg("shpchp: Presence/Notify input change.\n"); 126 ctrl_dbg(ctrl, "Presence/Notify input change.\n");
127 127
128 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); 128 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset);
129 129
@@ -135,13 +135,15 @@ u8 shpchp_handle_presence_change(u8 hp_slot, struct controller *ctrl)
135 /* 135 /*
136 * Card Present 136 * Card Present
137 */ 137 */
138 info("Card present on Slot(%s)\n", slot_name(p_slot)); 138 ctrl_info(ctrl, "Card present on Slot(%s)\n",
139 slot_name(p_slot));
139 event_type = INT_PRESENCE_ON; 140 event_type = INT_PRESENCE_ON;
140 } else { 141 } else {
141 /* 142 /*
142 * Not Present 143 * Not Present
143 */ 144 */
144 info("Card not present on Slot(%s)\n", slot_name(p_slot)); 145 ctrl_info(ctrl, "Card not present on Slot(%s)\n",
146 slot_name(p_slot));
145 event_type = INT_PRESENCE_OFF; 147 event_type = INT_PRESENCE_OFF;
146 } 148 }
147 149
@@ -156,7 +158,7 @@ u8 shpchp_handle_power_fault(u8 hp_slot, struct controller *ctrl)
156 u32 event_type; 158 u32 event_type;
157 159
158 /* Power fault */ 160 /* Power fault */
159 dbg("shpchp: Power fault interrupt received.\n"); 161 ctrl_dbg(ctrl, "Power fault interrupt received.\n");
160 162
161 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);
162 164
@@ -164,18 +166,19 @@ u8 shpchp_handle_power_fault(u8 hp_slot, struct controller *ctrl)
164 /* 166 /*
165 * Power fault Cleared 167 * Power fault Cleared
166 */ 168 */
167 info("Power fault cleared on Slot(%s)\n", slot_name(p_slot)); 169 ctrl_info(ctrl, "Power fault cleared on Slot(%s)\n",
170 slot_name(p_slot));
168 p_slot->status = 0x00; 171 p_slot->status = 0x00;
169 event_type = INT_POWER_FAULT_CLEAR; 172 event_type = INT_POWER_FAULT_CLEAR;
170 } else { 173 } else {
171 /* 174 /*
172 * Power fault 175 * Power fault
173 */ 176 */
174 info("Power fault on Slot(%s)\n", slot_name(p_slot)); 177 ctrl_info(ctrl, "Power fault on Slot(%s)\n", slot_name(p_slot));
175 event_type = INT_POWER_FAULT; 178 event_type = INT_POWER_FAULT;
176 /* set power fault status for this board */ 179 /* set power fault status for this board */
177 p_slot->status = 0xFF; 180 p_slot->status = 0xFF;
178 info("power fault bit %x set\n", hp_slot); 181 ctrl_info(ctrl, "power fault bit %x set\n", hp_slot);
179 } 182 }
180 183
181 queue_interrupt_event(p_slot, event_type); 184 queue_interrupt_event(p_slot, event_type);
@@ -191,10 +194,10 @@ static int change_bus_speed(struct controller *ctrl, struct slot *p_slot,
191{ 194{
192 int rc = 0; 195 int rc = 0;
193 196
194 dbg("%s: change to speed %d\n", __func__, speed); 197 ctrl_dbg(ctrl, "%s: change to speed %d\n", __func__, speed);
195 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))) {
196 err("%s: Issue of set bus speed mode command failed\n", 199 ctrl_err(ctrl, "%s: Issue of set bus speed mode command "
197 __func__); 200 "failed\n", __func__);
198 return WRONG_BUS_FREQUENCY; 201 return WRONG_BUS_FREQUENCY;
199 } 202 }
200 return rc; 203 return rc;
@@ -212,8 +215,8 @@ static int fix_bus_speed(struct controller *ctrl, struct slot *pslot,
212 */ 215 */
213 if (flag) { 216 if (flag) {
214 if (asp < bsp) { 217 if (asp < bsp) {
215 err("%s: speed of bus %x and adapter %x mismatch\n", 218 ctrl_err(ctrl, "%s: speed of bus %x and adapter %x "
216 __func__, bsp, asp); 219 "mismatch\n", __func__, bsp, asp);
217 rc = WRONG_BUS_FREQUENCY; 220 rc = WRONG_BUS_FREQUENCY;
218 } 221 }
219 return rc; 222 return rc;
@@ -246,14 +249,14 @@ static int board_added(struct slot *p_slot)
246 249
247 hp_slot = p_slot->device - ctrl->slot_device_offset; 250 hp_slot = p_slot->device - ctrl->slot_device_offset;
248 251
249 dbg("%s: p_slot->device, slot_offset, hp_slot = %d, %d ,%d\n", 252 ctrl_dbg(ctrl,
250 __func__, p_slot->device, 253 "%s: p_slot->device, slot_offset, hp_slot = %d, %d ,%d\n",
251 ctrl->slot_device_offset, hp_slot); 254 __func__, p_slot->device, ctrl->slot_device_offset, hp_slot);
252 255
253 /* Power on slot without connecting to bus */ 256 /* Power on slot without connecting to bus */
254 rc = p_slot->hpc_ops->power_on_slot(p_slot); 257 rc = p_slot->hpc_ops->power_on_slot(p_slot);
255 if (rc) { 258 if (rc) {
256 err("%s: Failed to power on slot\n", __func__); 259 ctrl_err(ctrl, "%s: Failed to power on slot\n", __func__);
257 return -1; 260 return -1;
258 } 261 }
259 262
@@ -262,33 +265,36 @@ static int board_added(struct slot *p_slot)
262 return WRONG_BUS_FREQUENCY; 265 return WRONG_BUS_FREQUENCY;
263 266
264 if ((rc = p_slot->hpc_ops->set_bus_speed_mode(p_slot, PCI_SPEED_33MHz))) { 267 if ((rc = p_slot->hpc_ops->set_bus_speed_mode(p_slot, PCI_SPEED_33MHz))) {
265 err("%s: Issue of set bus speed mode command failed\n", __func__); 268 ctrl_err(ctrl, "%s: Issue of set bus speed mode command"
269 " failed\n", __func__);
266 return WRONG_BUS_FREQUENCY; 270 return WRONG_BUS_FREQUENCY;
267 } 271 }
268 272
269 /* turn on board, blink green LED, turn off Amber LED */ 273 /* turn on board, blink green LED, turn off Amber LED */
270 if ((rc = p_slot->hpc_ops->slot_enable(p_slot))) { 274 if ((rc = p_slot->hpc_ops->slot_enable(p_slot))) {
271 err("%s: Issue of Slot Enable command failed\n", __func__); 275 ctrl_err(ctrl, "%s: Issue of Slot Enable command"
276 " failed\n", __func__);
272 return rc; 277 return rc;
273 } 278 }
274 } 279 }
275 280
276 rc = p_slot->hpc_ops->get_adapter_speed(p_slot, &asp); 281 rc = p_slot->hpc_ops->get_adapter_speed(p_slot, &asp);
277 if (rc) { 282 if (rc) {
278 err("%s: Can't get adapter speed or bus mode mismatch\n", 283 ctrl_err(ctrl, "%s: Can't get adapter speed or bus mode "
279 __func__); 284 "mismatch\n", __func__);
280 return WRONG_BUS_FREQUENCY; 285 return WRONG_BUS_FREQUENCY;
281 } 286 }
282 287
283 rc = p_slot->hpc_ops->get_cur_bus_speed(p_slot, &bsp); 288 rc = p_slot->hpc_ops->get_cur_bus_speed(p_slot, &bsp);
284 if (rc) { 289 if (rc) {
285 err("%s: Can't get bus operation speed\n", __func__); 290 ctrl_err(ctrl, "%s: Can't get bus operation speed\n", __func__);
286 return WRONG_BUS_FREQUENCY; 291 return WRONG_BUS_FREQUENCY;
287 } 292 }
288 293
289 rc = p_slot->hpc_ops->get_max_bus_speed(p_slot, &msp); 294 rc = p_slot->hpc_ops->get_max_bus_speed(p_slot, &msp);
290 if (rc) { 295 if (rc) {
291 err("%s: Can't get max bus operation speed\n", __func__); 296 ctrl_err(ctrl, "%s: Can't get max bus operation speed\n",
297 __func__);
292 msp = bsp; 298 msp = bsp;
293 } 299 }
294 300
@@ -296,9 +302,9 @@ static int board_added(struct slot *p_slot)
296 if (!list_empty(&ctrl->pci_dev->subordinate->devices)) 302 if (!list_empty(&ctrl->pci_dev->subordinate->devices))
297 slots_not_empty = 1; 303 slots_not_empty = 1;
298 304
299 dbg("%s: slots_not_empty %d, adapter_speed %d, bus_speed %d, " 305 ctrl_dbg(ctrl, "%s: slots_not_empty %d, adapter_speed %d, bus_speed %d,"
300 "max_bus_speed %d\n", __func__, slots_not_empty, asp, 306 " max_bus_speed %d\n", __func__, slots_not_empty, asp,
301 bsp, msp); 307 bsp, msp);
302 308
303 rc = fix_bus_speed(ctrl, p_slot, slots_not_empty, asp, bsp, msp); 309 rc = fix_bus_speed(ctrl, p_slot, slots_not_empty, asp, bsp, msp);
304 if (rc) 310 if (rc)
@@ -306,26 +312,27 @@ static int board_added(struct slot *p_slot)
306 312
307 /* turn on board, blink green LED, turn off Amber LED */ 313 /* turn on board, blink green LED, turn off Amber LED */
308 if ((rc = p_slot->hpc_ops->slot_enable(p_slot))) { 314 if ((rc = p_slot->hpc_ops->slot_enable(p_slot))) {
309 err("%s: Issue of Slot Enable command failed\n", __func__); 315 ctrl_err(ctrl, "%s: Issue of Slot Enable command failed\n",
316 __func__);
310 return rc; 317 return rc;
311 } 318 }
312 319
313 /* Wait for ~1 second */ 320 /* Wait for ~1 second */
314 msleep(1000); 321 msleep(1000);
315 322
316 dbg("%s: slot status = %x\n", __func__, p_slot->status); 323 ctrl_dbg(ctrl, "%s: slot status = %x\n", __func__, p_slot->status);
317 /* Check for a power fault */ 324 /* Check for a power fault */
318 if (p_slot->status == 0xFF) { 325 if (p_slot->status == 0xFF) {
319 /* power fault occurred, but it was benign */ 326 /* power fault occurred, but it was benign */
320 dbg("%s: power fault\n", __func__); 327 ctrl_dbg(ctrl, "%s: power fault\n", __func__);
321 rc = POWER_FAILURE; 328 rc = POWER_FAILURE;
322 p_slot->status = 0; 329 p_slot->status = 0;
323 goto err_exit; 330 goto err_exit;
324 } 331 }
325 332
326 if (shpchp_configure_device(p_slot)) { 333 if (shpchp_configure_device(p_slot)) {
327 err("Cannot add device at 0x%x:0x%x\n", p_slot->bus, 334 ctrl_err(ctrl, "Cannot add device at 0x%x:0x%x\n",
328 p_slot->device); 335 p_slot->bus, p_slot->device);
329 goto err_exit; 336 goto err_exit;
330 } 337 }
331 338
@@ -341,7 +348,8 @@ err_exit:
341 /* turn off slot, turn on Amber LED, turn off Green LED */ 348 /* turn off slot, turn on Amber LED, turn off Green LED */
342 rc = p_slot->hpc_ops->slot_disable(p_slot); 349 rc = p_slot->hpc_ops->slot_disable(p_slot);
343 if (rc) { 350 if (rc) {
344 err("%s: Issue of Slot Disable command failed\n", __func__); 351 ctrl_err(ctrl, "%s: Issue of Slot Disable command failed\n",
352 __func__);
345 return rc; 353 return rc;
346 } 354 }
347 355
@@ -365,7 +373,7 @@ static int remove_board(struct slot *p_slot)
365 hp_slot = p_slot->device - ctrl->slot_device_offset; 373 hp_slot = p_slot->device - ctrl->slot_device_offset;
366 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); 374 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset);
367 375
368 dbg("In %s, hp_slot = %d\n", __func__, hp_slot); 376 ctrl_dbg(ctrl, "In %s, hp_slot = %d\n", __func__, hp_slot);
369 377
370 /* Change status to shutdown */ 378 /* Change status to shutdown */
371 if (p_slot->is_a_board) 379 if (p_slot->is_a_board)
@@ -374,13 +382,15 @@ static int remove_board(struct slot *p_slot)
374 /* turn off slot, turn on Amber LED, turn off Green LED */ 382 /* turn off slot, turn on Amber LED, turn off Green LED */
375 rc = p_slot->hpc_ops->slot_disable(p_slot); 383 rc = p_slot->hpc_ops->slot_disable(p_slot);
376 if (rc) { 384 if (rc) {
377 err("%s: Issue of Slot Disable command failed\n", __func__); 385 ctrl_err(ctrl, "%s: Issue of Slot Disable command failed\n",
386 __func__);
378 return rc; 387 return rc;
379 } 388 }
380 389
381 rc = p_slot->hpc_ops->set_attention_status(p_slot, 0); 390 rc = p_slot->hpc_ops->set_attention_status(p_slot, 0);
382 if (rc) { 391 if (rc) {
383 err("%s: Issue of Set Attention command failed\n", __func__); 392 ctrl_err(ctrl, "%s: Issue of Set Attention command failed\n",
393 __func__);
384 return rc; 394 return rc;
385 } 395 }
386 396
@@ -439,7 +449,8 @@ void shpchp_queue_pushbutton_work(struct work_struct *work)
439 449
440 info = kmalloc(sizeof(*info), GFP_KERNEL); 450 info = kmalloc(sizeof(*info), GFP_KERNEL);
441 if (!info) { 451 if (!info) {
442 err("%s: Cannot allocate memory\n", __func__); 452 ctrl_err(p_slot->ctrl, "%s: Cannot allocate memory\n",
453 __func__);
443 return; 454 return;
444 } 455 }
445 info->p_slot = p_slot; 456 info->p_slot = p_slot;
@@ -486,18 +497,19 @@ static int update_slot_info (struct slot *slot)
486static void handle_button_press_event(struct slot *p_slot) 497static void handle_button_press_event(struct slot *p_slot)
487{ 498{
488 u8 getstatus; 499 u8 getstatus;
500 struct controller *ctrl = p_slot->ctrl;
489 501
490 switch (p_slot->state) { 502 switch (p_slot->state) {
491 case STATIC_STATE: 503 case STATIC_STATE:
492 p_slot->hpc_ops->get_power_status(p_slot, &getstatus); 504 p_slot->hpc_ops->get_power_status(p_slot, &getstatus);
493 if (getstatus) { 505 if (getstatus) {
494 p_slot->state = BLINKINGOFF_STATE; 506 p_slot->state = BLINKINGOFF_STATE;
495 info("PCI slot #%s - powering off due to button " 507 ctrl_info(ctrl, "PCI slot #%s - powering off due to "
496 "press.\n", slot_name(p_slot)); 508 "button press.\n", slot_name(p_slot));
497 } else { 509 } else {
498 p_slot->state = BLINKINGON_STATE; 510 p_slot->state = BLINKINGON_STATE;
499 info("PCI slot #%s - powering on due to button " 511 ctrl_info(ctrl, "PCI slot #%s - powering on due to "
500 "press.\n", slot_name(p_slot)); 512 "button press.\n", slot_name(p_slot));
501 } 513 }
502 /* blink green LED and turn off amber */ 514 /* blink green LED and turn off amber */
503 p_slot->hpc_ops->green_led_blink(p_slot); 515 p_slot->hpc_ops->green_led_blink(p_slot);
@@ -512,16 +524,17 @@ static void handle_button_press_event(struct slot *p_slot)
512 * press the attention again before the 5 sec. limit 524 * press the attention again before the 5 sec. limit
513 * expires to cancel hot-add or hot-remove 525 * expires to cancel hot-add or hot-remove
514 */ 526 */
515 info("Button cancel on Slot(%s)\n", slot_name(p_slot)); 527 ctrl_info(ctrl, "Button cancel on Slot(%s)\n",
516 dbg("%s: button cancel\n", __func__); 528 slot_name(p_slot));
529 ctrl_dbg(ctrl, "%s: button cancel\n", __func__);
517 cancel_delayed_work(&p_slot->work); 530 cancel_delayed_work(&p_slot->work);
518 if (p_slot->state == BLINKINGOFF_STATE) 531 if (p_slot->state == BLINKINGOFF_STATE)
519 p_slot->hpc_ops->green_led_on(p_slot); 532 p_slot->hpc_ops->green_led_on(p_slot);
520 else 533 else
521 p_slot->hpc_ops->green_led_off(p_slot); 534 p_slot->hpc_ops->green_led_off(p_slot);
522 p_slot->hpc_ops->set_attention_status(p_slot, 0); 535 p_slot->hpc_ops->set_attention_status(p_slot, 0);
523 info("PCI slot #%s - action canceled due to button press\n", 536 ctrl_info(ctrl, "PCI slot #%s - action canceled due to "
524 slot_name(p_slot)); 537 "button press\n", slot_name(p_slot));
525 p_slot->state = STATIC_STATE; 538 p_slot->state = STATIC_STATE;
526 break; 539 break;
527 case POWEROFF_STATE: 540 case POWEROFF_STATE:
@@ -531,11 +544,12 @@ static void handle_button_press_event(struct slot *p_slot)
531 * this means that the previous attention button action 544 * this means that the previous attention button action
532 * to hot-add or hot-remove is undergoing 545 * to hot-add or hot-remove is undergoing
533 */ 546 */
534 info("Button ignore on Slot(%s)\n", slot_name(p_slot)); 547 ctrl_info(ctrl, "Button ignore on Slot(%s)\n",
548 slot_name(p_slot));
535 update_slot_info(p_slot); 549 update_slot_info(p_slot);
536 break; 550 break;
537 default: 551 default:
538 warn("Not a valid state\n"); 552 ctrl_warn(ctrl, "Not a valid state\n");
539 break; 553 break;
540 } 554 }
541} 555}
@@ -551,7 +565,7 @@ static void interrupt_event_handler(struct work_struct *work)
551 handle_button_press_event(p_slot); 565 handle_button_press_event(p_slot);
552 break; 566 break;
553 case INT_POWER_FAULT: 567 case INT_POWER_FAULT:
554 dbg("%s: power fault\n", __func__); 568 ctrl_dbg(p_slot->ctrl, "%s: power fault\n", __func__);
555 p_slot->hpc_ops->set_attention_status(p_slot, 1); 569 p_slot->hpc_ops->set_attention_status(p_slot, 1);
556 p_slot->hpc_ops->green_led_off(p_slot); 570 p_slot->hpc_ops->green_led_off(p_slot);
557 break; 571 break;
@@ -569,22 +583,24 @@ static int shpchp_enable_slot (struct slot *p_slot)
569{ 583{
570 u8 getstatus = 0; 584 u8 getstatus = 0;
571 int rc, retval = -ENODEV; 585 int rc, retval = -ENODEV;
586 struct controller *ctrl = p_slot->ctrl;
572 587
573 /* Check to see if (latch closed, card present, power off) */ 588 /* Check to see if (latch closed, card present, power off) */
574 mutex_lock(&p_slot->ctrl->crit_sect); 589 mutex_lock(&p_slot->ctrl->crit_sect);
575 rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); 590 rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus);
576 if (rc || !getstatus) { 591 if (rc || !getstatus) {
577 info("No adapter on slot(%s)\n", slot_name(p_slot)); 592 ctrl_info(ctrl, "No adapter on slot(%s)\n", slot_name(p_slot));
578 goto out; 593 goto out;
579 } 594 }
580 rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); 595 rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
581 if (rc || getstatus) { 596 if (rc || getstatus) {
582 info("Latch open on slot(%s)\n", slot_name(p_slot)); 597 ctrl_info(ctrl, "Latch open on slot(%s)\n", slot_name(p_slot));
583 goto out; 598 goto out;
584 } 599 }
585 rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); 600 rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus);
586 if (rc || getstatus) { 601 if (rc || getstatus) {
587 info("Already enabled on slot(%s)\n", slot_name(p_slot)); 602 ctrl_info(ctrl, "Already enabled on slot(%s)\n",
603 slot_name(p_slot));
588 goto out; 604 goto out;
589 } 605 }
590 606
@@ -593,7 +609,7 @@ static int shpchp_enable_slot (struct slot *p_slot)
593 /* We have to save the presence info for these slots */ 609 /* We have to save the presence info for these slots */
594 p_slot->hpc_ops->get_adapter_status(p_slot, &(p_slot->presence_save)); 610 p_slot->hpc_ops->get_adapter_status(p_slot, &(p_slot->presence_save));
595 p_slot->hpc_ops->get_power_status(p_slot, &(p_slot->pwr_save)); 611 p_slot->hpc_ops->get_power_status(p_slot, &(p_slot->pwr_save));
596 dbg("%s: p_slot->pwr_save %x\n", __func__, p_slot->pwr_save); 612 ctrl_dbg(ctrl, "%s: p_slot->pwr_save %x\n", __func__, p_slot->pwr_save);
597 p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); 613 p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
598 614
599 if(((p_slot->ctrl->pci_dev->vendor == PCI_VENDOR_ID_AMD) || 615 if(((p_slot->ctrl->pci_dev->vendor == PCI_VENDOR_ID_AMD) ||
@@ -624,6 +640,7 @@ static int shpchp_disable_slot (struct slot *p_slot)
624{ 640{
625 u8 getstatus = 0; 641 u8 getstatus = 0;
626 int rc, retval = -ENODEV; 642 int rc, retval = -ENODEV;
643 struct controller *ctrl = p_slot->ctrl;
627 644
628 if (!p_slot->ctrl) 645 if (!p_slot->ctrl)
629 return -ENODEV; 646 return -ENODEV;
@@ -633,17 +650,18 @@ static int shpchp_disable_slot (struct slot *p_slot)
633 650
634 rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); 651 rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus);
635 if (rc || !getstatus) { 652 if (rc || !getstatus) {
636 info("No adapter on slot(%s)\n", slot_name(p_slot)); 653 ctrl_info(ctrl, "No adapter on slot(%s)\n", slot_name(p_slot));
637 goto out; 654 goto out;
638 } 655 }
639 rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); 656 rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
640 if (rc || getstatus) { 657 if (rc || getstatus) {
641 info("Latch open on slot(%s)\n", slot_name(p_slot)); 658 ctrl_info(ctrl, "Latch open on slot(%s)\n", slot_name(p_slot));
642 goto out; 659 goto out;
643 } 660 }
644 rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); 661 rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus);
645 if (rc || !getstatus) { 662 if (rc || !getstatus) {
646 info("Already disabled slot(%s)\n", slot_name(p_slot)); 663 ctrl_info(ctrl, "Already disabled slot(%s)\n",
664 slot_name(p_slot));
647 goto out; 665 goto out;
648 } 666 }
649 667
@@ -657,6 +675,7 @@ static int shpchp_disable_slot (struct slot *p_slot)
657int shpchp_sysfs_enable_slot(struct slot *p_slot) 675int shpchp_sysfs_enable_slot(struct slot *p_slot)
658{ 676{
659 int retval = -ENODEV; 677 int retval = -ENODEV;
678 struct controller *ctrl = p_slot->ctrl;
660 679
661 mutex_lock(&p_slot->lock); 680 mutex_lock(&p_slot->lock);
662 switch (p_slot->state) { 681 switch (p_slot->state) {
@@ -670,15 +689,17 @@ int shpchp_sysfs_enable_slot(struct slot *p_slot)
670 p_slot->state = STATIC_STATE; 689 p_slot->state = STATIC_STATE;
671 break; 690 break;
672 case POWERON_STATE: 691 case POWERON_STATE:
673 info("Slot %s is already in powering on state\n", 692 ctrl_info(ctrl, "Slot %s is already in powering on state\n",
674 slot_name(p_slot)); 693 slot_name(p_slot));
675 break; 694 break;
676 case BLINKINGOFF_STATE: 695 case BLINKINGOFF_STATE:
677 case POWEROFF_STATE: 696 case POWEROFF_STATE:
678 info("Already enabled on slot %s\n", slot_name(p_slot)); 697 ctrl_info(ctrl, "Already enabled on slot %s\n",
698 slot_name(p_slot));
679 break; 699 break;
680 default: 700 default:
681 err("Not a valid state on slot %s\n", slot_name(p_slot)); 701 ctrl_err(ctrl, "Not a valid state on slot %s\n",
702 slot_name(p_slot));
682 break; 703 break;
683 } 704 }
684 mutex_unlock(&p_slot->lock); 705 mutex_unlock(&p_slot->lock);
@@ -689,6 +710,7 @@ int shpchp_sysfs_enable_slot(struct slot *p_slot)
689int shpchp_sysfs_disable_slot(struct slot *p_slot) 710int shpchp_sysfs_disable_slot(struct slot *p_slot)
690{ 711{
691 int retval = -ENODEV; 712 int retval = -ENODEV;
713 struct controller *ctrl = p_slot->ctrl;
692 714
693 mutex_lock(&p_slot->lock); 715 mutex_lock(&p_slot->lock);
694 switch (p_slot->state) { 716 switch (p_slot->state) {
@@ -702,15 +724,17 @@ int shpchp_sysfs_disable_slot(struct slot *p_slot)
702 p_slot->state = STATIC_STATE; 724 p_slot->state = STATIC_STATE;
703 break; 725 break;
704 case POWEROFF_STATE: 726 case POWEROFF_STATE:
705 info("Slot %s is already in powering off state\n", 727 ctrl_info(ctrl, "Slot %s is already in powering off state\n",
706 slot_name(p_slot)); 728 slot_name(p_slot));
707 break; 729 break;
708 case BLINKINGON_STATE: 730 case BLINKINGON_STATE:
709 case POWERON_STATE: 731 case POWERON_STATE:
710 info("Already disabled on slot %s\n", slot_name(p_slot)); 732 ctrl_info(ctrl, "Already disabled on slot %s\n",
733 slot_name(p_slot));
711 break; 734 break;
712 default: 735 default:
713 err("Not a valid state on slot %s\n", slot_name(p_slot)); 736 ctrl_err(ctrl, "Not a valid state on slot %s\n",
737 slot_name(p_slot));
714 break; 738 break;
715 } 739 }
716 mutex_unlock(&p_slot->lock); 740 mutex_unlock(&p_slot->lock);