aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/shpchp_ctrl.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-01-13 10:02:15 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-03-23 17:35:10 -0500
commit6aa4cdd07139ba4d5b89139b0070d795cc4dea88 (patch)
tree3bfe5e8ef916f0e27c0ea8ef0d073fcd01cfff29 /drivers/pci/hotplug/shpchp_ctrl.c
parentc408a3794d6222ab43ab26648385f850a82f0803 (diff)
[PATCH] PCI hotplug: convert semaphores to mutex
semaphore to mutex conversion. the conversion was generated via scripts, and the result was validated automatically via a script as well. build tested with allyesconfig. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug/shpchp_ctrl.c')
-rw-r--r--drivers/pci/hotplug/shpchp_ctrl.c98
1 files changed, 49 insertions, 49 deletions
diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c
index 643252d9bf3b..65e69252e2f9 100644
--- a/drivers/pci/hotplug/shpchp_ctrl.c
+++ b/drivers/pci/hotplug/shpchp_ctrl.c
@@ -242,10 +242,10 @@ static int change_bus_speed(struct controller *ctrl, struct slot *p_slot,
242 int rc = 0; 242 int rc = 0;
243 243
244 dbg("%s: change to speed %d\n", __FUNCTION__, speed); 244 dbg("%s: change to speed %d\n", __FUNCTION__, speed);
245 down(&ctrl->crit_sect); 245 mutex_lock(&ctrl->crit_sect);
246 if ((rc = p_slot->hpc_ops->set_bus_speed_mode(p_slot, speed))) { 246 if ((rc = p_slot->hpc_ops->set_bus_speed_mode(p_slot, speed))) {
247 err("%s: Issue of set bus speed mode command failed\n", __FUNCTION__); 247 err("%s: Issue of set bus speed mode command failed\n", __FUNCTION__);
248 up(&ctrl->crit_sect); 248 mutex_unlock(&ctrl->crit_sect);
249 return WRONG_BUS_FREQUENCY; 249 return WRONG_BUS_FREQUENCY;
250 } 250 }
251 251
@@ -253,10 +253,10 @@ static int change_bus_speed(struct controller *ctrl, struct slot *p_slot,
253 err("%s: Can't set bus speed/mode in the case of adapter & bus mismatch\n", 253 err("%s: Can't set bus speed/mode in the case of adapter & bus mismatch\n",
254 __FUNCTION__); 254 __FUNCTION__);
255 err("%s: Error code (%d)\n", __FUNCTION__, rc); 255 err("%s: Error code (%d)\n", __FUNCTION__, rc);
256 up(&ctrl->crit_sect); 256 mutex_unlock(&ctrl->crit_sect);
257 return WRONG_BUS_FREQUENCY; 257 return WRONG_BUS_FREQUENCY;
258 } 258 }
259 up(&ctrl->crit_sect); 259 mutex_unlock(&ctrl->crit_sect);
260 return rc; 260 return rc;
261} 261}
262 262
@@ -319,14 +319,14 @@ static int board_added(struct slot *p_slot)
319 ctrl->slot_device_offset, hp_slot); 319 ctrl->slot_device_offset, hp_slot);
320 320
321 /* Wait for exclusive access to hardware */ 321 /* Wait for exclusive access to hardware */
322 down(&ctrl->crit_sect); 322 mutex_lock(&ctrl->crit_sect);
323 323
324 /* Power on slot without connecting to bus */ 324 /* Power on slot without connecting to bus */
325 rc = p_slot->hpc_ops->power_on_slot(p_slot); 325 rc = p_slot->hpc_ops->power_on_slot(p_slot);
326 if (rc) { 326 if (rc) {
327 err("%s: Failed to power on slot\n", __FUNCTION__); 327 err("%s: Failed to power on slot\n", __FUNCTION__);
328 /* Done with exclusive hardware access */ 328 /* Done with exclusive hardware access */
329 up(&ctrl->crit_sect); 329 mutex_unlock(&ctrl->crit_sect);
330 return -1; 330 return -1;
331 } 331 }
332 332
@@ -334,7 +334,7 @@ static int board_added(struct slot *p_slot)
334 if (rc) { 334 if (rc) {
335 err("%s: Failed to power on slot, error code(%d)\n", __FUNCTION__, rc); 335 err("%s: Failed to power on slot, error code(%d)\n", __FUNCTION__, rc);
336 /* Done with exclusive hardware access */ 336 /* Done with exclusive hardware access */
337 up(&ctrl->crit_sect); 337 mutex_unlock(&ctrl->crit_sect);
338 return -1; 338 return -1;
339 } 339 }
340 340
@@ -345,7 +345,7 @@ static int board_added(struct slot *p_slot)
345 345
346 if ((rc = p_slot->hpc_ops->set_bus_speed_mode(p_slot, PCI_SPEED_33MHz))) { 346 if ((rc = p_slot->hpc_ops->set_bus_speed_mode(p_slot, PCI_SPEED_33MHz))) {
347 err("%s: Issue of set bus speed mode command failed\n", __FUNCTION__); 347 err("%s: Issue of set bus speed mode command failed\n", __FUNCTION__);
348 up(&ctrl->crit_sect); 348 mutex_unlock(&ctrl->crit_sect);
349 return WRONG_BUS_FREQUENCY; 349 return WRONG_BUS_FREQUENCY;
350 } 350 }
351 351
@@ -353,19 +353,19 @@ static int board_added(struct slot *p_slot)
353 err("%s: Can't set bus speed/mode in the case of adapter & bus mismatch\n", 353 err("%s: Can't set bus speed/mode in the case of adapter & bus mismatch\n",
354 __FUNCTION__); 354 __FUNCTION__);
355 err("%s: Error code (%d)\n", __FUNCTION__, rc); 355 err("%s: Error code (%d)\n", __FUNCTION__, rc);
356 up(&ctrl->crit_sect); 356 mutex_unlock(&ctrl->crit_sect);
357 return WRONG_BUS_FREQUENCY; 357 return WRONG_BUS_FREQUENCY;
358 } 358 }
359 /* turn on board, blink green LED, turn off Amber LED */ 359 /* turn on board, blink green LED, turn off Amber LED */
360 if ((rc = p_slot->hpc_ops->slot_enable(p_slot))) { 360 if ((rc = p_slot->hpc_ops->slot_enable(p_slot))) {
361 err("%s: Issue of Slot Enable command failed\n", __FUNCTION__); 361 err("%s: Issue of Slot Enable command failed\n", __FUNCTION__);
362 up(&ctrl->crit_sect); 362 mutex_unlock(&ctrl->crit_sect);
363 return rc; 363 return rc;
364 } 364 }
365 365
366 if ((rc = p_slot->hpc_ops->check_cmd_status(ctrl))) { 366 if ((rc = p_slot->hpc_ops->check_cmd_status(ctrl))) {
367 err("%s: Failed to enable slot, error code(%d)\n", __FUNCTION__, rc); 367 err("%s: Failed to enable slot, error code(%d)\n", __FUNCTION__, rc);
368 up(&ctrl->crit_sect); 368 mutex_unlock(&ctrl->crit_sect);
369 return rc; 369 return rc;
370 } 370 }
371 } 371 }
@@ -380,7 +380,7 @@ static int board_added(struct slot *p_slot)
380 if (rc || adapter_speed == PCI_SPEED_UNKNOWN) { 380 if (rc || adapter_speed == PCI_SPEED_UNKNOWN) {
381 err("%s: Can't get adapter speed or bus mode mismatch\n", __FUNCTION__); 381 err("%s: Can't get adapter speed or bus mode mismatch\n", __FUNCTION__);
382 /* Done with exclusive hardware access */ 382 /* Done with exclusive hardware access */
383 up(&ctrl->crit_sect); 383 mutex_unlock(&ctrl->crit_sect);
384 return WRONG_BUS_FREQUENCY; 384 return WRONG_BUS_FREQUENCY;
385 } 385 }
386 386
@@ -388,7 +388,7 @@ static int board_added(struct slot *p_slot)
388 if (rc || bus_speed == PCI_SPEED_UNKNOWN) { 388 if (rc || bus_speed == PCI_SPEED_UNKNOWN) {
389 err("%s: Can't get bus operation speed\n", __FUNCTION__); 389 err("%s: Can't get bus operation speed\n", __FUNCTION__);
390 /* Done with exclusive hardware access */ 390 /* Done with exclusive hardware access */
391 up(&ctrl->crit_sect); 391 mutex_unlock(&ctrl->crit_sect);
392 return WRONG_BUS_FREQUENCY; 392 return WRONG_BUS_FREQUENCY;
393 } 393 }
394 394
@@ -399,7 +399,7 @@ static int board_added(struct slot *p_slot)
399 } 399 }
400 400
401 /* Done with exclusive hardware access */ 401 /* Done with exclusive hardware access */
402 up(&ctrl->crit_sect); 402 mutex_unlock(&ctrl->crit_sect);
403 403
404 if ((rc = p_slot->hpc_ops->get_prog_int(p_slot, &pi))) { 404 if ((rc = p_slot->hpc_ops->get_prog_int(p_slot, &pi))) {
405 err("%s: Can't get controller programming interface, set it to 1\n", __FUNCTION__); 405 err("%s: Can't get controller programming interface, set it to 1\n", __FUNCTION__);
@@ -481,21 +481,21 @@ static int board_added(struct slot *p_slot)
481 return rc; 481 return rc;
482 } 482 }
483 483
484 down(&ctrl->crit_sect); 484 mutex_lock(&ctrl->crit_sect);
485 /* turn on board, blink green LED, turn off Amber LED */ 485 /* turn on board, blink green LED, turn off Amber LED */
486 if ((rc = p_slot->hpc_ops->slot_enable(p_slot))) { 486 if ((rc = p_slot->hpc_ops->slot_enable(p_slot))) {
487 err("%s: Issue of Slot Enable command failed\n", __FUNCTION__); 487 err("%s: Issue of Slot Enable command failed\n", __FUNCTION__);
488 up(&ctrl->crit_sect); 488 mutex_unlock(&ctrl->crit_sect);
489 return rc; 489 return rc;
490 } 490 }
491 491
492 if ((rc = p_slot->hpc_ops->check_cmd_status(ctrl))) { 492 if ((rc = p_slot->hpc_ops->check_cmd_status(ctrl))) {
493 err("%s: Failed to enable slot, error code(%d)\n", __FUNCTION__, rc); 493 err("%s: Failed to enable slot, error code(%d)\n", __FUNCTION__, rc);
494 up(&ctrl->crit_sect); 494 mutex_unlock(&ctrl->crit_sect);
495 return rc; 495 return rc;
496 } 496 }
497 497
498 up(&ctrl->crit_sect); 498 mutex_unlock(&ctrl->crit_sect);
499 499
500 /* Wait for ~1 second */ 500 /* Wait for ~1 second */
501 wait_for_ctrl_irq (ctrl); 501 wait_for_ctrl_irq (ctrl);
@@ -521,25 +521,25 @@ static int board_added(struct slot *p_slot)
521 p_slot->pwr_save = 1; 521 p_slot->pwr_save = 1;
522 522
523 /* Wait for exclusive access to hardware */ 523 /* Wait for exclusive access to hardware */
524 down(&ctrl->crit_sect); 524 mutex_lock(&ctrl->crit_sect);
525 525
526 p_slot->hpc_ops->green_led_on(p_slot); 526 p_slot->hpc_ops->green_led_on(p_slot);
527 527
528 /* Done with exclusive hardware access */ 528 /* Done with exclusive hardware access */
529 up(&ctrl->crit_sect); 529 mutex_unlock(&ctrl->crit_sect);
530 530
531 return 0; 531 return 0;
532 532
533err_exit: 533err_exit:
534 /* Wait for exclusive access to hardware */ 534 /* Wait for exclusive access to hardware */
535 down(&ctrl->crit_sect); 535 mutex_lock(&ctrl->crit_sect);
536 536
537 /* turn off slot, turn on Amber LED, turn off Green LED */ 537 /* turn off slot, turn on Amber LED, turn off Green LED */
538 rc = p_slot->hpc_ops->slot_disable(p_slot); 538 rc = p_slot->hpc_ops->slot_disable(p_slot);
539 if (rc) { 539 if (rc) {
540 err("%s: Issue of Slot Disable command failed\n", __FUNCTION__); 540 err("%s: Issue of Slot Disable command failed\n", __FUNCTION__);
541 /* Done with exclusive hardware access */ 541 /* Done with exclusive hardware access */
542 up(&ctrl->crit_sect); 542 mutex_unlock(&ctrl->crit_sect);
543 return rc; 543 return rc;
544 } 544 }
545 545
@@ -547,12 +547,12 @@ err_exit:
547 if (rc) { 547 if (rc) {
548 err("%s: Failed to disable slot, error code(%d)\n", __FUNCTION__, rc); 548 err("%s: Failed to disable slot, error code(%d)\n", __FUNCTION__, rc);
549 /* Done with exclusive hardware access */ 549 /* Done with exclusive hardware access */
550 up(&ctrl->crit_sect); 550 mutex_unlock(&ctrl->crit_sect);
551 return rc; 551 return rc;
552 } 552 }
553 553
554 /* Done with exclusive hardware access */ 554 /* Done with exclusive hardware access */
555 up(&ctrl->crit_sect); 555 mutex_unlock(&ctrl->crit_sect);
556 556
557 return(rc); 557 return(rc);
558} 558}
@@ -581,14 +581,14 @@ static int remove_board(struct slot *p_slot)
581 p_slot->status = 0x01; 581 p_slot->status = 0x01;
582 582
583 /* Wait for exclusive access to hardware */ 583 /* Wait for exclusive access to hardware */
584 down(&ctrl->crit_sect); 584 mutex_lock(&ctrl->crit_sect);
585 585
586 /* turn off slot, turn on Amber LED, turn off Green LED */ 586 /* turn off slot, turn on Amber LED, turn off Green LED */
587 rc = p_slot->hpc_ops->slot_disable(p_slot); 587 rc = p_slot->hpc_ops->slot_disable(p_slot);
588 if (rc) { 588 if (rc) {
589 err("%s: Issue of Slot Disable command failed\n", __FUNCTION__); 589 err("%s: Issue of Slot Disable command failed\n", __FUNCTION__);
590 /* Done with exclusive hardware access */ 590 /* Done with exclusive hardware access */
591 up(&ctrl->crit_sect); 591 mutex_unlock(&ctrl->crit_sect);
592 return rc; 592 return rc;
593 } 593 }
594 594
@@ -596,7 +596,7 @@ static int remove_board(struct slot *p_slot)
596 if (rc) { 596 if (rc) {
597 err("%s: Failed to disable slot, error code(%d)\n", __FUNCTION__, rc); 597 err("%s: Failed to disable slot, error code(%d)\n", __FUNCTION__, rc);
598 /* Done with exclusive hardware access */ 598 /* Done with exclusive hardware access */
599 up(&ctrl->crit_sect); 599 mutex_unlock(&ctrl->crit_sect);
600 return rc; 600 return rc;
601 } 601 }
602 602
@@ -604,12 +604,12 @@ static int remove_board(struct slot *p_slot)
604 if (rc) { 604 if (rc) {
605 err("%s: Issue of Set Attention command failed\n", __FUNCTION__); 605 err("%s: Issue of Set Attention command failed\n", __FUNCTION__);
606 /* Done with exclusive hardware access */ 606 /* Done with exclusive hardware access */
607 up(&ctrl->crit_sect); 607 mutex_unlock(&ctrl->crit_sect);
608 return rc; 608 return rc;
609 } 609 }
610 610
611 /* Done with exclusive hardware access */ 611 /* Done with exclusive hardware access */
612 up(&ctrl->crit_sect); 612 mutex_unlock(&ctrl->crit_sect);
613 613
614 p_slot->pwr_save = 0; 614 p_slot->pwr_save = 0;
615 p_slot->is_a_board = 0; 615 p_slot->is_a_board = 0;
@@ -656,12 +656,12 @@ static void shpchp_pushbutton_thread (unsigned long slot)
656 656
657 if (shpchp_enable_slot(p_slot)) { 657 if (shpchp_enable_slot(p_slot)) {
658 /* Wait for exclusive access to hardware */ 658 /* Wait for exclusive access to hardware */
659 down(&p_slot->ctrl->crit_sect); 659 mutex_lock(&p_slot->ctrl->crit_sect);
660 660
661 p_slot->hpc_ops->green_led_off(p_slot); 661 p_slot->hpc_ops->green_led_off(p_slot);
662 662
663 /* Done with exclusive hardware access */ 663 /* Done with exclusive hardware access */
664 up(&p_slot->ctrl->crit_sect); 664 mutex_unlock(&p_slot->ctrl->crit_sect);
665 } 665 }
666 p_slot->state = STATIC_STATE; 666 p_slot->state = STATIC_STATE;
667 } 667 }
@@ -768,25 +768,25 @@ static void interrupt_event_handler(struct controller *ctrl)
768 switch (p_slot->state) { 768 switch (p_slot->state) {
769 case BLINKINGOFF_STATE: 769 case BLINKINGOFF_STATE:
770 /* Wait for exclusive access to hardware */ 770 /* Wait for exclusive access to hardware */
771 down(&ctrl->crit_sect); 771 mutex_lock(&ctrl->crit_sect);
772 772
773 p_slot->hpc_ops->green_led_on(p_slot); 773 p_slot->hpc_ops->green_led_on(p_slot);
774 774
775 p_slot->hpc_ops->set_attention_status(p_slot, 0); 775 p_slot->hpc_ops->set_attention_status(p_slot, 0);
776 776
777 /* Done with exclusive hardware access */ 777 /* Done with exclusive hardware access */
778 up(&ctrl->crit_sect); 778 mutex_unlock(&ctrl->crit_sect);
779 break; 779 break;
780 case BLINKINGON_STATE: 780 case BLINKINGON_STATE:
781 /* Wait for exclusive access to hardware */ 781 /* Wait for exclusive access to hardware */
782 down(&ctrl->crit_sect); 782 mutex_lock(&ctrl->crit_sect);
783 783
784 p_slot->hpc_ops->green_led_off(p_slot); 784 p_slot->hpc_ops->green_led_off(p_slot);
785 785
786 p_slot->hpc_ops->set_attention_status(p_slot, 0); 786 p_slot->hpc_ops->set_attention_status(p_slot, 0);
787 787
788 /* Done with exclusive hardware access */ 788 /* Done with exclusive hardware access */
789 up(&ctrl->crit_sect); 789 mutex_unlock(&ctrl->crit_sect);
790 790
791 break; 791 break;
792 default: 792 default:
@@ -813,7 +813,7 @@ static void interrupt_event_handler(struct controller *ctrl)
813 } 813 }
814 814
815 /* Wait for exclusive access to hardware */ 815 /* Wait for exclusive access to hardware */
816 down(&ctrl->crit_sect); 816 mutex_lock(&ctrl->crit_sect);
817 817
818 /* blink green LED and turn off amber */ 818 /* blink green LED and turn off amber */
819 p_slot->hpc_ops->green_led_blink(p_slot); 819 p_slot->hpc_ops->green_led_blink(p_slot);
@@ -821,7 +821,7 @@ static void interrupt_event_handler(struct controller *ctrl)
821 p_slot->hpc_ops->set_attention_status(p_slot, 0); 821 p_slot->hpc_ops->set_attention_status(p_slot, 0);
822 822
823 /* Done with exclusive hardware access */ 823 /* Done with exclusive hardware access */
824 up(&ctrl->crit_sect); 824 mutex_unlock(&ctrl->crit_sect);
825 825
826 init_timer(&p_slot->task_event); 826 init_timer(&p_slot->task_event);
827 p_slot->task_event.expires = jiffies + 5 * HZ; /* 5 second delay */ 827 p_slot->task_event.expires = jiffies + 5 * HZ; /* 5 second delay */
@@ -834,14 +834,14 @@ static void interrupt_event_handler(struct controller *ctrl)
834 /***********POWER FAULT********************/ 834 /***********POWER FAULT********************/
835 dbg("%s: power fault\n", __FUNCTION__); 835 dbg("%s: power fault\n", __FUNCTION__);
836 /* Wait for exclusive access to hardware */ 836 /* Wait for exclusive access to hardware */
837 down(&ctrl->crit_sect); 837 mutex_lock(&ctrl->crit_sect);
838 838
839 p_slot->hpc_ops->set_attention_status(p_slot, 1); 839 p_slot->hpc_ops->set_attention_status(p_slot, 1);
840 840
841 p_slot->hpc_ops->green_led_off(p_slot); 841 p_slot->hpc_ops->green_led_off(p_slot);
842 842
843 /* Done with exclusive hardware access */ 843 /* Done with exclusive hardware access */
844 up(&ctrl->crit_sect); 844 mutex_unlock(&ctrl->crit_sect);
845 } else { 845 } else {
846 /* refresh notification */ 846 /* refresh notification */
847 if (p_slot) 847 if (p_slot)
@@ -865,26 +865,26 @@ int shpchp_enable_slot (struct slot *p_slot)
865 int rc; 865 int rc;
866 866
867 /* Check to see if (latch closed, card present, power off) */ 867 /* Check to see if (latch closed, card present, power off) */
868 down(&p_slot->ctrl->crit_sect); 868 mutex_lock(&p_slot->ctrl->crit_sect);
869 rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); 869 rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus);
870 if (rc || !getstatus) { 870 if (rc || !getstatus) {
871 info("%s: no adapter on slot(%x)\n", __FUNCTION__, p_slot->number); 871 info("%s: no adapter on slot(%x)\n", __FUNCTION__, p_slot->number);
872 up(&p_slot->ctrl->crit_sect); 872 mutex_unlock(&p_slot->ctrl->crit_sect);
873 return -ENODEV; 873 return -ENODEV;
874 } 874 }
875 rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); 875 rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
876 if (rc || getstatus) { 876 if (rc || getstatus) {
877 info("%s: latch open on slot(%x)\n", __FUNCTION__, p_slot->number); 877 info("%s: latch open on slot(%x)\n", __FUNCTION__, p_slot->number);
878 up(&p_slot->ctrl->crit_sect); 878 mutex_unlock(&p_slot->ctrl->crit_sect);
879 return -ENODEV; 879 return -ENODEV;
880 } 880 }
881 rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); 881 rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus);
882 if (rc || getstatus) { 882 if (rc || getstatus) {
883 info("%s: already enabled on slot(%x)\n", __FUNCTION__, p_slot->number); 883 info("%s: already enabled on slot(%x)\n", __FUNCTION__, p_slot->number);
884 up(&p_slot->ctrl->crit_sect); 884 mutex_unlock(&p_slot->ctrl->crit_sect);
885 return -ENODEV; 885 return -ENODEV;
886 } 886 }
887 up(&p_slot->ctrl->crit_sect); 887 mutex_unlock(&p_slot->ctrl->crit_sect);
888 888
889 p_slot->is_a_board = 1; 889 p_slot->is_a_board = 1;
890 890
@@ -925,27 +925,27 @@ int shpchp_disable_slot (struct slot *p_slot)
925 return -ENODEV; 925 return -ENODEV;
926 926
927 /* Check to see if (latch closed, card present, power on) */ 927 /* Check to see if (latch closed, card present, power on) */
928 down(&p_slot->ctrl->crit_sect); 928 mutex_lock(&p_slot->ctrl->crit_sect);
929 929
930 ret = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); 930 ret = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus);
931 if (ret || !getstatus) { 931 if (ret || !getstatus) {
932 info("%s: no adapter on slot(%x)\n", __FUNCTION__, p_slot->number); 932 info("%s: no adapter on slot(%x)\n", __FUNCTION__, p_slot->number);
933 up(&p_slot->ctrl->crit_sect); 933 mutex_unlock(&p_slot->ctrl->crit_sect);
934 return -ENODEV; 934 return -ENODEV;
935 } 935 }
936 ret = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); 936 ret = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
937 if (ret || getstatus) { 937 if (ret || getstatus) {
938 info("%s: latch open on slot(%x)\n", __FUNCTION__, p_slot->number); 938 info("%s: latch open on slot(%x)\n", __FUNCTION__, p_slot->number);
939 up(&p_slot->ctrl->crit_sect); 939 mutex_unlock(&p_slot->ctrl->crit_sect);
940 return -ENODEV; 940 return -ENODEV;
941 } 941 }
942 ret = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); 942 ret = p_slot->hpc_ops->get_power_status(p_slot, &getstatus);
943 if (ret || !getstatus) { 943 if (ret || !getstatus) {
944 info("%s: already disabled slot(%x)\n", __FUNCTION__, p_slot->number); 944 info("%s: already disabled slot(%x)\n", __FUNCTION__, p_slot->number);
945 up(&p_slot->ctrl->crit_sect); 945 mutex_unlock(&p_slot->ctrl->crit_sect);
946 return -ENODEV; 946 return -ENODEV;
947 } 947 }
948 up(&p_slot->ctrl->crit_sect); 948 mutex_unlock(&p_slot->ctrl->crit_sect);
949 949
950 ret = remove_board(p_slot); 950 ret = remove_board(p_slot);
951 update_slot_info(p_slot); 951 update_slot_info(p_slot);