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.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c
index beb081703fd..b3c9ae580d9 100644
--- a/drivers/pci/hotplug/pciehp_ctrl.c
+++ b/drivers/pci/hotplug/pciehp_ctrl.c
@@ -519,13 +519,9 @@ int pciehp_enable_slot(struct slot *p_slot)
519 int rc; 519 int rc;
520 struct controller *ctrl = p_slot->ctrl; 520 struct controller *ctrl = p_slot->ctrl;
521 521
522 /* Check to see if (latch closed, card present, power off) */
523 mutex_lock(&p_slot->ctrl->crit_sect);
524
525 rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); 522 rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus);
526 if (rc || !getstatus) { 523 if (rc || !getstatus) {
527 ctrl_info(ctrl, "No adapter on slot(%s)\n", slot_name(p_slot)); 524 ctrl_info(ctrl, "No adapter on slot(%s)\n", slot_name(p_slot));
528 mutex_unlock(&p_slot->ctrl->crit_sect);
529 return -ENODEV; 525 return -ENODEV;
530 } 526 }
531 if (MRL_SENS(p_slot->ctrl)) { 527 if (MRL_SENS(p_slot->ctrl)) {
@@ -533,7 +529,6 @@ int pciehp_enable_slot(struct slot *p_slot)
533 if (rc || getstatus) { 529 if (rc || getstatus) {
534 ctrl_info(ctrl, "Latch open on slot(%s)\n", 530 ctrl_info(ctrl, "Latch open on slot(%s)\n",
535 slot_name(p_slot)); 531 slot_name(p_slot));
536 mutex_unlock(&p_slot->ctrl->crit_sect);
537 return -ENODEV; 532 return -ENODEV;
538 } 533 }
539 } 534 }
@@ -543,7 +538,6 @@ int pciehp_enable_slot(struct slot *p_slot)
543 if (rc || getstatus) { 538 if (rc || getstatus) {
544 ctrl_info(ctrl, "Already enabled on slot(%s)\n", 539 ctrl_info(ctrl, "Already enabled on slot(%s)\n",
545 slot_name(p_slot)); 540 slot_name(p_slot));
546 mutex_unlock(&p_slot->ctrl->crit_sect);
547 return -EINVAL; 541 return -EINVAL;
548 } 542 }
549 } 543 }
@@ -557,7 +551,6 @@ int pciehp_enable_slot(struct slot *p_slot)
557 551
558 update_slot_info(p_slot); 552 update_slot_info(p_slot);
559 553
560 mutex_unlock(&p_slot->ctrl->crit_sect);
561 return rc; 554 return rc;
562} 555}
563 556
@@ -571,15 +564,11 @@ int pciehp_disable_slot(struct slot *p_slot)
571 if (!p_slot->ctrl) 564 if (!p_slot->ctrl)
572 return 1; 565 return 1;
573 566
574 /* Check to see if (latch closed, card present, power on) */
575 mutex_lock(&p_slot->ctrl->crit_sect);
576
577 if (!HP_SUPR_RM(p_slot->ctrl)) { 567 if (!HP_SUPR_RM(p_slot->ctrl)) {
578 ret = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); 568 ret = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus);
579 if (ret || !getstatus) { 569 if (ret || !getstatus) {
580 ctrl_info(ctrl, "No adapter on slot(%s)\n", 570 ctrl_info(ctrl, "No adapter on slot(%s)\n",
581 slot_name(p_slot)); 571 slot_name(p_slot));
582 mutex_unlock(&p_slot->ctrl->crit_sect);
583 return -ENODEV; 572 return -ENODEV;
584 } 573 }
585 } 574 }
@@ -589,7 +578,6 @@ int pciehp_disable_slot(struct slot *p_slot)
589 if (ret || getstatus) { 578 if (ret || getstatus) {
590 ctrl_info(ctrl, "Latch open on slot(%s)\n", 579 ctrl_info(ctrl, "Latch open on slot(%s)\n",
591 slot_name(p_slot)); 580 slot_name(p_slot));
592 mutex_unlock(&p_slot->ctrl->crit_sect);
593 return -ENODEV; 581 return -ENODEV;
594 } 582 }
595 } 583 }
@@ -599,7 +587,6 @@ int pciehp_disable_slot(struct slot *p_slot)
599 if (ret || !getstatus) { 587 if (ret || !getstatus) {
600 ctrl_info(ctrl, "Already disabled on slot(%s)\n", 588 ctrl_info(ctrl, "Already disabled on slot(%s)\n",
601 slot_name(p_slot)); 589 slot_name(p_slot));
602 mutex_unlock(&p_slot->ctrl->crit_sect);
603 return -EINVAL; 590 return -EINVAL;
604 } 591 }
605 } 592 }
@@ -607,7 +594,6 @@ int pciehp_disable_slot(struct slot *p_slot)
607 ret = remove_board(p_slot); 594 ret = remove_board(p_slot);
608 update_slot_info(p_slot); 595 update_slot_info(p_slot);
609 596
610 mutex_unlock(&p_slot->ctrl->crit_sect);
611 return ret; 597 return ret;
612} 598}
613 599