aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/pciehp_ctrl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/hotplug/pciehp_ctrl.c')
-rw-r--r--drivers/pci/hotplug/pciehp_ctrl.c136
1 files changed, 75 insertions, 61 deletions
diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c
index 96a5d55a4983..acb7f9efd182 100644
--- a/drivers/pci/hotplug/pciehp_ctrl.c
+++ b/drivers/pci/hotplug/pciehp_ctrl.c
@@ -58,14 +58,15 @@ static int queue_interrupt_event(struct slot *p_slot, u32 event_type)
58u8 pciehp_handle_attention_button(struct slot *p_slot) 58u8 pciehp_handle_attention_button(struct slot *p_slot)
59{ 59{
60 u32 event_type; 60 u32 event_type;
61 struct controller *ctrl = p_slot->ctrl;
61 62
62 /* Attention Button Change */ 63 /* Attention Button Change */
63 dbg("pciehp: Attention button interrupt received.\n"); 64 ctrl_dbg(ctrl, "Attention button interrupt received.\n");
64 65
65 /* 66 /*
66 * Button pressed - See if need to TAKE ACTION!!! 67 * Button pressed - See if need to TAKE ACTION!!!
67 */ 68 */
68 info("Button pressed on Slot(%s)\n", p_slot->name); 69 ctrl_info(ctrl, "Button pressed on Slot(%s)\n", p_slot->name);
69 event_type = INT_BUTTON_PRESS; 70 event_type = INT_BUTTON_PRESS;
70 71
71 queue_interrupt_event(p_slot, event_type); 72 queue_interrupt_event(p_slot, event_type);
@@ -77,22 +78,23 @@ u8 pciehp_handle_switch_change(struct slot *p_slot)
77{ 78{
78 u8 getstatus; 79 u8 getstatus;
79 u32 event_type; 80 u32 event_type;
81 struct controller *ctrl = p_slot->ctrl;
80 82
81 /* Switch Change */ 83 /* Switch Change */
82 dbg("pciehp: Switch interrupt received.\n"); 84 ctrl_dbg(ctrl, "Switch interrupt received.\n");
83 85
84 p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); 86 p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
85 if (getstatus) { 87 if (getstatus) {
86 /* 88 /*
87 * Switch opened 89 * Switch opened
88 */ 90 */
89 info("Latch open on Slot(%s)\n", p_slot->name); 91 ctrl_info(ctrl, "Latch open on Slot(%s)\n", p_slot->name);
90 event_type = INT_SWITCH_OPEN; 92 event_type = INT_SWITCH_OPEN;
91 } else { 93 } else {
92 /* 94 /*
93 * Switch closed 95 * Switch closed
94 */ 96 */
95 info("Latch close on Slot(%s)\n", p_slot->name); 97 ctrl_info(ctrl, "Latch close on Slot(%s)\n", p_slot->name);
96 event_type = INT_SWITCH_CLOSE; 98 event_type = INT_SWITCH_CLOSE;
97 } 99 }
98 100
@@ -105,9 +107,10 @@ u8 pciehp_handle_presence_change(struct slot *p_slot)
105{ 107{
106 u32 event_type; 108 u32 event_type;
107 u8 presence_save; 109 u8 presence_save;
110 struct controller *ctrl = p_slot->ctrl;
108 111
109 /* Presence Change */ 112 /* Presence Change */
110 dbg("pciehp: Presence/Notify input change.\n"); 113 ctrl_dbg(ctrl, "Presence/Notify input change.\n");
111 114
112 /* Switch is open, assume a presence change 115 /* Switch is open, assume a presence change
113 * Save the presence state 116 * Save the presence state
@@ -117,13 +120,13 @@ u8 pciehp_handle_presence_change(struct slot *p_slot)
117 /* 120 /*
118 * Card Present 121 * Card Present
119 */ 122 */
120 info("Card present on Slot(%s)\n", p_slot->name); 123 ctrl_info(ctrl, "Card present on Slot(%s)\n", p_slot->name);
121 event_type = INT_PRESENCE_ON; 124 event_type = INT_PRESENCE_ON;
122 } else { 125 } else {
123 /* 126 /*
124 * Not Present 127 * Not Present
125 */ 128 */
126 info("Card not present on Slot(%s)\n", p_slot->name); 129 ctrl_info(ctrl, "Card not present on Slot(%s)\n", p_slot->name);
127 event_type = INT_PRESENCE_OFF; 130 event_type = INT_PRESENCE_OFF;
128 } 131 }
129 132
@@ -135,23 +138,25 @@ u8 pciehp_handle_presence_change(struct slot *p_slot)
135u8 pciehp_handle_power_fault(struct slot *p_slot) 138u8 pciehp_handle_power_fault(struct slot *p_slot)
136{ 139{
137 u32 event_type; 140 u32 event_type;
141 struct controller *ctrl = p_slot->ctrl;
138 142
139 /* power fault */ 143 /* power fault */
140 dbg("pciehp: Power fault interrupt received.\n"); 144 ctrl_dbg(ctrl, "Power fault interrupt received.\n");
141 145
142 if ( !(p_slot->hpc_ops->query_power_fault(p_slot))) { 146 if ( !(p_slot->hpc_ops->query_power_fault(p_slot))) {
143 /* 147 /*
144 * power fault Cleared 148 * power fault Cleared
145 */ 149 */
146 info("Power fault cleared on Slot(%s)\n", p_slot->name); 150 ctrl_info(ctrl, "Power fault cleared on Slot(%s)\n",
151 p_slot->name);
147 event_type = INT_POWER_FAULT_CLEAR; 152 event_type = INT_POWER_FAULT_CLEAR;
148 } else { 153 } else {
149 /* 154 /*
150 * power fault 155 * power fault
151 */ 156 */
152 info("Power fault on Slot(%s)\n", p_slot->name); 157 ctrl_info(ctrl, "Power fault on Slot(%s)\n", p_slot->name);
153 event_type = INT_POWER_FAULT; 158 event_type = INT_POWER_FAULT;
154 info("power fault bit %x set\n", 0); 159 ctrl_info(ctrl, "power fault bit %x set\n", 0);
155 } 160 }
156 161
157 queue_interrupt_event(p_slot, event_type); 162 queue_interrupt_event(p_slot, event_type);
@@ -168,8 +173,9 @@ static void set_slot_off(struct controller *ctrl, struct slot * pslot)
168 /* turn off slot, turn on Amber LED, turn off Green LED if supported*/ 173 /* turn off slot, turn on Amber LED, turn off Green LED if supported*/
169 if (POWER_CTRL(ctrl)) { 174 if (POWER_CTRL(ctrl)) {
170 if (pslot->hpc_ops->power_off_slot(pslot)) { 175 if (pslot->hpc_ops->power_off_slot(pslot)) {
171 err("%s: Issue of Slot Power Off command failed\n", 176 ctrl_err(ctrl,
172 __func__); 177 "%s: Issue of Slot Power Off command failed\n",
178 __func__);
173 return; 179 return;
174 } 180 }
175 } 181 }
@@ -186,8 +192,8 @@ static void set_slot_off(struct controller *ctrl, struct slot * pslot)
186 192
187 if (ATTN_LED(ctrl)) { 193 if (ATTN_LED(ctrl)) {
188 if (pslot->hpc_ops->set_attention_status(pslot, 1)) { 194 if (pslot->hpc_ops->set_attention_status(pslot, 1)) {
189 err("%s: Issue of Set Attention Led command failed\n", 195 ctrl_err(ctrl, "%s: Issue of Set Attention "
190 __func__); 196 "Led command failed\n", __func__);
191 return; 197 return;
192 } 198 }
193 } 199 }
@@ -205,9 +211,9 @@ static int board_added(struct slot *p_slot)
205 int retval = 0; 211 int retval = 0;
206 struct controller *ctrl = p_slot->ctrl; 212 struct controller *ctrl = p_slot->ctrl;
207 213
208 dbg("%s: slot device, slot offset, hp slot = %d, %d ,%d\n", 214 ctrl_dbg(ctrl, "%s: slot device, slot offset, hp slot = %d, %d ,%d\n",
209 __func__, p_slot->device, 215 __func__, p_slot->device, ctrl->slot_device_offset,
210 ctrl->slot_device_offset, p_slot->hp_slot); 216 p_slot->hp_slot);
211 217
212 if (POWER_CTRL(ctrl)) { 218 if (POWER_CTRL(ctrl)) {
213 /* Power on slot */ 219 /* Power on slot */
@@ -225,22 +231,22 @@ static int board_added(struct slot *p_slot)
225 /* Check link training status */ 231 /* Check link training status */
226 retval = p_slot->hpc_ops->check_lnk_status(ctrl); 232 retval = p_slot->hpc_ops->check_lnk_status(ctrl);
227 if (retval) { 233 if (retval) {
228 err("%s: Failed to check link status\n", __func__); 234 ctrl_err(ctrl, "%s: Failed to check link status\n", __func__);
229 set_slot_off(ctrl, p_slot); 235 set_slot_off(ctrl, p_slot);
230 return retval; 236 return retval;
231 } 237 }
232 238
233 /* Check for a power fault */ 239 /* Check for a power fault */
234 if (p_slot->hpc_ops->query_power_fault(p_slot)) { 240 if (p_slot->hpc_ops->query_power_fault(p_slot)) {
235 dbg("%s: power fault detected\n", __func__); 241 ctrl_dbg(ctrl, "%s: power fault detected\n", __func__);
236 retval = POWER_FAILURE; 242 retval = POWER_FAILURE;
237 goto err_exit; 243 goto err_exit;
238 } 244 }
239 245
240 retval = pciehp_configure_device(p_slot); 246 retval = pciehp_configure_device(p_slot);
241 if (retval) { 247 if (retval) {
242 err("Cannot add device 0x%x:%x\n", p_slot->bus, 248 ctrl_err(ctrl, "Cannot add device 0x%x:%x\n",
243 p_slot->device); 249 p_slot->bus, p_slot->device);
244 goto err_exit; 250 goto err_exit;
245 } 251 }
246 252
@@ -272,14 +278,14 @@ static int remove_board(struct slot *p_slot)
272 if (retval) 278 if (retval)
273 return retval; 279 return retval;
274 280
275 dbg("In %s, hp_slot = %d\n", __func__, p_slot->hp_slot); 281 ctrl_dbg(ctrl, "In %s, hp_slot = %d\n", __func__, p_slot->hp_slot);
276 282
277 if (POWER_CTRL(ctrl)) { 283 if (POWER_CTRL(ctrl)) {
278 /* power off slot */ 284 /* power off slot */
279 retval = p_slot->hpc_ops->power_off_slot(p_slot); 285 retval = p_slot->hpc_ops->power_off_slot(p_slot);
280 if (retval) { 286 if (retval) {
281 err("%s: Issue of Slot Disable command failed\n", 287 ctrl_err(ctrl, "%s: Issue of Slot Disable command "
282 __func__); 288 "failed\n", __func__);
283 return retval; 289 return retval;
284 } 290 }
285 } 291 }
@@ -320,8 +326,8 @@ static void pciehp_power_thread(struct work_struct *work)
320 switch (p_slot->state) { 326 switch (p_slot->state) {
321 case POWEROFF_STATE: 327 case POWEROFF_STATE:
322 mutex_unlock(&p_slot->lock); 328 mutex_unlock(&p_slot->lock);
323 dbg("%s: disabling bus:device(%x:%x)\n", 329 ctrl_dbg(p_slot->ctrl, "%s: disabling bus:device(%x:%x)\n",
324 __func__, p_slot->bus, p_slot->device); 330 __func__, p_slot->bus, p_slot->device);
325 pciehp_disable_slot(p_slot); 331 pciehp_disable_slot(p_slot);
326 mutex_lock(&p_slot->lock); 332 mutex_lock(&p_slot->lock);
327 p_slot->state = STATIC_STATE; 333 p_slot->state = STATIC_STATE;
@@ -349,7 +355,8 @@ void pciehp_queue_pushbutton_work(struct work_struct *work)
349 355
350 info = kmalloc(sizeof(*info), GFP_KERNEL); 356 info = kmalloc(sizeof(*info), GFP_KERNEL);
351 if (!info) { 357 if (!info) {
352 err("%s: Cannot allocate memory\n", __func__); 358 ctrl_err(p_slot->ctrl, "%s: Cannot allocate memory\n",
359 __func__);
353 return; 360 return;
354 } 361 }
355 info->p_slot = p_slot; 362 info->p_slot = p_slot;
@@ -403,12 +410,14 @@ static void handle_button_press_event(struct slot *p_slot)
403 p_slot->hpc_ops->get_power_status(p_slot, &getstatus); 410 p_slot->hpc_ops->get_power_status(p_slot, &getstatus);
404 if (getstatus) { 411 if (getstatus) {
405 p_slot->state = BLINKINGOFF_STATE; 412 p_slot->state = BLINKINGOFF_STATE;
406 info("PCI slot #%s - powering off due to button " 413 ctrl_info(ctrl,
407 "press.\n", p_slot->name); 414 "PCI slot #%s - powering off due to button "
415 "press.\n", p_slot->name);
408 } else { 416 } else {
409 p_slot->state = BLINKINGON_STATE; 417 p_slot->state = BLINKINGON_STATE;
410 info("PCI slot #%s - powering on due to button " 418 ctrl_info(ctrl,
411 "press.\n", p_slot->name); 419 "PCI slot #%s - powering on due to button "
420 "press.\n", p_slot->name);
412 } 421 }
413 /* blink green LED and turn off amber */ 422 /* blink green LED and turn off amber */
414 if (PWR_LED(ctrl)) 423 if (PWR_LED(ctrl))
@@ -425,8 +434,8 @@ static void handle_button_press_event(struct slot *p_slot)
425 * press the attention again before the 5 sec. limit 434 * press the attention again before the 5 sec. limit
426 * expires to cancel hot-add or hot-remove 435 * expires to cancel hot-add or hot-remove
427 */ 436 */
428 info("Button cancel on Slot(%s)\n", p_slot->name); 437 ctrl_info(ctrl, "Button cancel on Slot(%s)\n", p_slot->name);
429 dbg("%s: button cancel\n", __func__); 438 ctrl_dbg(ctrl, "%s: button cancel\n", __func__);
430 cancel_delayed_work(&p_slot->work); 439 cancel_delayed_work(&p_slot->work);
431 if (p_slot->state == BLINKINGOFF_STATE) { 440 if (p_slot->state == BLINKINGOFF_STATE) {
432 if (PWR_LED(ctrl)) 441 if (PWR_LED(ctrl))
@@ -437,8 +446,8 @@ static void handle_button_press_event(struct slot *p_slot)
437 } 446 }
438 if (ATTN_LED(ctrl)) 447 if (ATTN_LED(ctrl))
439 p_slot->hpc_ops->set_attention_status(p_slot, 0); 448 p_slot->hpc_ops->set_attention_status(p_slot, 0);
440 info("PCI slot #%s - action canceled due to button press\n", 449 ctrl_info(ctrl, "PCI slot #%s - action canceled "
441 p_slot->name); 450 "due to button press\n", p_slot->name);
442 p_slot->state = STATIC_STATE; 451 p_slot->state = STATIC_STATE;
443 break; 452 break;
444 case POWEROFF_STATE: 453 case POWEROFF_STATE:
@@ -448,11 +457,11 @@ static void handle_button_press_event(struct slot *p_slot)
448 * this means that the previous attention button action 457 * this means that the previous attention button action
449 * to hot-add or hot-remove is undergoing 458 * to hot-add or hot-remove is undergoing
450 */ 459 */
451 info("Button ignore on Slot(%s)\n", p_slot->name); 460 ctrl_info(ctrl, "Button ignore on Slot(%s)\n", p_slot->name);
452 update_slot_info(p_slot); 461 update_slot_info(p_slot);
453 break; 462 break;
454 default: 463 default:
455 warn("Not a valid state\n"); 464 ctrl_warn(ctrl, "Not a valid state\n");
456 break; 465 break;
457 } 466 }
458} 467}
@@ -467,7 +476,8 @@ static void handle_surprise_event(struct slot *p_slot)
467 476
468 info = kmalloc(sizeof(*info), GFP_KERNEL); 477 info = kmalloc(sizeof(*info), GFP_KERNEL);
469 if (!info) { 478 if (!info) {
470 err("%s: Cannot allocate memory\n", __func__); 479 ctrl_err(p_slot->ctrl, "%s: Cannot allocate memory\n",
480 __func__);
471 return; 481 return;
472 } 482 }
473 info->p_slot = p_slot; 483 info->p_slot = p_slot;
@@ -505,7 +515,7 @@ static void interrupt_event_handler(struct work_struct *work)
505 case INT_PRESENCE_OFF: 515 case INT_PRESENCE_OFF:
506 if (!HP_SUPR_RM(ctrl)) 516 if (!HP_SUPR_RM(ctrl))
507 break; 517 break;
508 dbg("Surprise Removal\n"); 518 ctrl_dbg(ctrl, "Surprise Removal\n");
509 update_slot_info(p_slot); 519 update_slot_info(p_slot);
510 handle_surprise_event(p_slot); 520 handle_surprise_event(p_slot);
511 break; 521 break;
@@ -522,22 +532,23 @@ int pciehp_enable_slot(struct slot *p_slot)
522{ 532{
523 u8 getstatus = 0; 533 u8 getstatus = 0;
524 int rc; 534 int rc;
535 struct controller *ctrl = p_slot->ctrl;
525 536
526 /* Check to see if (latch closed, card present, power off) */ 537 /* Check to see if (latch closed, card present, power off) */
527 mutex_lock(&p_slot->ctrl->crit_sect); 538 mutex_lock(&p_slot->ctrl->crit_sect);
528 539
529 rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); 540 rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus);
530 if (rc || !getstatus) { 541 if (rc || !getstatus) {
531 info("%s: no adapter on slot(%s)\n", __func__, 542 ctrl_info(ctrl, "%s: no adapter on slot(%s)\n",
532 p_slot->name); 543 __func__, p_slot->name);
533 mutex_unlock(&p_slot->ctrl->crit_sect); 544 mutex_unlock(&p_slot->ctrl->crit_sect);
534 return -ENODEV; 545 return -ENODEV;
535 } 546 }
536 if (MRL_SENS(p_slot->ctrl)) { 547 if (MRL_SENS(p_slot->ctrl)) {
537 rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); 548 rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
538 if (rc || getstatus) { 549 if (rc || getstatus) {
539 info("%s: latch open on slot(%s)\n", __func__, 550 ctrl_info(ctrl, "%s: latch open on slot(%s)\n",
540 p_slot->name); 551 __func__, p_slot->name);
541 mutex_unlock(&p_slot->ctrl->crit_sect); 552 mutex_unlock(&p_slot->ctrl->crit_sect);
542 return -ENODEV; 553 return -ENODEV;
543 } 554 }
@@ -546,8 +557,8 @@ int pciehp_enable_slot(struct slot *p_slot)
546 if (POWER_CTRL(p_slot->ctrl)) { 557 if (POWER_CTRL(p_slot->ctrl)) {
547 rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); 558 rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus);
548 if (rc || getstatus) { 559 if (rc || getstatus) {
549 info("%s: already enabled on slot(%s)\n", __func__, 560 ctrl_info(ctrl, "%s: already enabled on slot(%s)\n",
550 p_slot->name); 561 __func__, p_slot->name);
551 mutex_unlock(&p_slot->ctrl->crit_sect); 562 mutex_unlock(&p_slot->ctrl->crit_sect);
552 return -EINVAL; 563 return -EINVAL;
553 } 564 }
@@ -571,6 +582,7 @@ int pciehp_disable_slot(struct slot *p_slot)
571{ 582{
572 u8 getstatus = 0; 583 u8 getstatus = 0;
573 int ret = 0; 584 int ret = 0;
585 struct controller *ctrl = p_slot->ctrl;
574 586
575 if (!p_slot->ctrl) 587 if (!p_slot->ctrl)
576 return 1; 588 return 1;
@@ -581,8 +593,8 @@ int pciehp_disable_slot(struct slot *p_slot)
581 if (!HP_SUPR_RM(p_slot->ctrl)) { 593 if (!HP_SUPR_RM(p_slot->ctrl)) {
582 ret = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); 594 ret = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus);
583 if (ret || !getstatus) { 595 if (ret || !getstatus) {
584 info("%s: no adapter on slot(%s)\n", __func__, 596 ctrl_info(ctrl, "%s: no adapter on slot(%s)\n",
585 p_slot->name); 597 __func__, p_slot->name);
586 mutex_unlock(&p_slot->ctrl->crit_sect); 598 mutex_unlock(&p_slot->ctrl->crit_sect);
587 return -ENODEV; 599 return -ENODEV;
588 } 600 }
@@ -591,8 +603,8 @@ int pciehp_disable_slot(struct slot *p_slot)
591 if (MRL_SENS(p_slot->ctrl)) { 603 if (MRL_SENS(p_slot->ctrl)) {
592 ret = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); 604 ret = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
593 if (ret || getstatus) { 605 if (ret || getstatus) {
594 info("%s: latch open on slot(%s)\n", __func__, 606 ctrl_info(ctrl, "%s: latch open on slot(%s)\n",
595 p_slot->name); 607 __func__, p_slot->name);
596 mutex_unlock(&p_slot->ctrl->crit_sect); 608 mutex_unlock(&p_slot->ctrl->crit_sect);
597 return -ENODEV; 609 return -ENODEV;
598 } 610 }
@@ -601,8 +613,8 @@ int pciehp_disable_slot(struct slot *p_slot)
601 if (POWER_CTRL(p_slot->ctrl)) { 613 if (POWER_CTRL(p_slot->ctrl)) {
602 ret = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); 614 ret = p_slot->hpc_ops->get_power_status(p_slot, &getstatus);
603 if (ret || !getstatus) { 615 if (ret || !getstatus) {
604 info("%s: already disabled slot(%s)\n", __func__, 616 ctrl_info(ctrl, "%s: already disabled slot(%s)\n",
605 p_slot->name); 617 __func__, p_slot->name);
606 mutex_unlock(&p_slot->ctrl->crit_sect); 618 mutex_unlock(&p_slot->ctrl->crit_sect);
607 return -EINVAL; 619 return -EINVAL;
608 } 620 }
@@ -618,6 +630,7 @@ int pciehp_disable_slot(struct slot *p_slot)
618int pciehp_sysfs_enable_slot(struct slot *p_slot) 630int pciehp_sysfs_enable_slot(struct slot *p_slot)
619{ 631{
620 int retval = -ENODEV; 632 int retval = -ENODEV;
633 struct controller *ctrl = p_slot->ctrl;
621 634
622 mutex_lock(&p_slot->lock); 635 mutex_lock(&p_slot->lock);
623 switch (p_slot->state) { 636 switch (p_slot->state) {
@@ -631,15 +644,15 @@ int pciehp_sysfs_enable_slot(struct slot *p_slot)
631 p_slot->state = STATIC_STATE; 644 p_slot->state = STATIC_STATE;
632 break; 645 break;
633 case POWERON_STATE: 646 case POWERON_STATE:
634 info("Slot %s is already in powering on state\n", 647 ctrl_info(ctrl, "Slot %s is already in powering on state\n",
635 p_slot->name); 648 p_slot->name);
636 break; 649 break;
637 case BLINKINGOFF_STATE: 650 case BLINKINGOFF_STATE:
638 case POWEROFF_STATE: 651 case POWEROFF_STATE:
639 info("Already enabled on slot %s\n", p_slot->name); 652 ctrl_info(ctrl, "Already enabled on slot %s\n", p_slot->name);
640 break; 653 break;
641 default: 654 default:
642 err("Not a valid state on slot %s\n", p_slot->name); 655 ctrl_err(ctrl, "Not a valid state on slot %s\n", p_slot->name);
643 break; 656 break;
644 } 657 }
645 mutex_unlock(&p_slot->lock); 658 mutex_unlock(&p_slot->lock);
@@ -650,6 +663,7 @@ int pciehp_sysfs_enable_slot(struct slot *p_slot)
650int pciehp_sysfs_disable_slot(struct slot *p_slot) 663int pciehp_sysfs_disable_slot(struct slot *p_slot)
651{ 664{
652 int retval = -ENODEV; 665 int retval = -ENODEV;
666 struct controller *ctrl = p_slot->ctrl;
653 667
654 mutex_lock(&p_slot->lock); 668 mutex_lock(&p_slot->lock);
655 switch (p_slot->state) { 669 switch (p_slot->state) {
@@ -663,15 +677,15 @@ int pciehp_sysfs_disable_slot(struct slot *p_slot)
663 p_slot->state = STATIC_STATE; 677 p_slot->state = STATIC_STATE;
664 break; 678 break;
665 case POWEROFF_STATE: 679 case POWEROFF_STATE:
666 info("Slot %s is already in powering off state\n", 680 ctrl_info(ctrl, "Slot %s is already in powering off state\n",
667 p_slot->name); 681 p_slot->name);
668 break; 682 break;
669 case BLINKINGON_STATE: 683 case BLINKINGON_STATE:
670 case POWERON_STATE: 684 case POWERON_STATE:
671 info("Already disabled on slot %s\n", p_slot->name); 685 ctrl_info(ctrl, "Already disabled on slot %s\n", p_slot->name);
672 break; 686 break;
673 default: 687 default:
674 err("Not a valid state on slot %s\n", p_slot->name); 688 ctrl_err(ctrl, "Not a valid state on slot %s\n", p_slot->name);
675 break; 689 break;
676 } 690 }
677 mutex_unlock(&p_slot->lock); 691 mutex_unlock(&p_slot->lock);