aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/cpqphp_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/cpqphp_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/cpqphp_ctrl.c')
-rw-r--r--drivers/pci/hotplug/cpqphp_ctrl.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c
index 771ed34b1819..72eb8e2d2065 100644
--- a/drivers/pci/hotplug/cpqphp_ctrl.c
+++ b/drivers/pci/hotplug/cpqphp_ctrl.c
@@ -1299,7 +1299,7 @@ static u32 board_replaced(struct pci_func *func, struct controller *ctrl)
1299 **********************************/ 1299 **********************************/
1300 rc = CARD_FUNCTIONING; 1300 rc = CARD_FUNCTIONING;
1301 } else { 1301 } else {
1302 down(&ctrl->crit_sect); 1302 mutex_lock(&ctrl->crit_sect);
1303 1303
1304 /* turn on board without attaching to the bus */ 1304 /* turn on board without attaching to the bus */
1305 enable_slot_power (ctrl, hp_slot); 1305 enable_slot_power (ctrl, hp_slot);
@@ -1333,12 +1333,12 @@ static u32 board_replaced(struct pci_func *func, struct controller *ctrl)
1333 /* Wait for SOBS to be unset */ 1333 /* Wait for SOBS to be unset */
1334 wait_for_ctrl_irq (ctrl); 1334 wait_for_ctrl_irq (ctrl);
1335 1335
1336 up(&ctrl->crit_sect); 1336 mutex_unlock(&ctrl->crit_sect);
1337 1337
1338 if (rc) 1338 if (rc)
1339 return rc; 1339 return rc;
1340 1340
1341 down(&ctrl->crit_sect); 1341 mutex_lock(&ctrl->crit_sect);
1342 1342
1343 slot_enable (ctrl, hp_slot); 1343 slot_enable (ctrl, hp_slot);
1344 green_LED_blink (ctrl, hp_slot); 1344 green_LED_blink (ctrl, hp_slot);
@@ -1350,7 +1350,7 @@ static u32 board_replaced(struct pci_func *func, struct controller *ctrl)
1350 /* Wait for SOBS to be unset */ 1350 /* Wait for SOBS to be unset */
1351 wait_for_ctrl_irq (ctrl); 1351 wait_for_ctrl_irq (ctrl);
1352 1352
1353 up(&ctrl->crit_sect); 1353 mutex_unlock(&ctrl->crit_sect);
1354 1354
1355 /* Wait for ~1 second because of hot plug spec */ 1355 /* Wait for ~1 second because of hot plug spec */
1356 long_delay(1*HZ); 1356 long_delay(1*HZ);
@@ -1375,7 +1375,7 @@ static u32 board_replaced(struct pci_func *func, struct controller *ctrl)
1375 * called for the "base" bus/dev/func of an 1375 * called for the "base" bus/dev/func of an
1376 * adapter. */ 1376 * adapter. */
1377 1377
1378 down(&ctrl->crit_sect); 1378 mutex_lock(&ctrl->crit_sect);
1379 1379
1380 amber_LED_on (ctrl, hp_slot); 1380 amber_LED_on (ctrl, hp_slot);
1381 green_LED_off (ctrl, hp_slot); 1381 green_LED_off (ctrl, hp_slot);
@@ -1386,7 +1386,7 @@ static u32 board_replaced(struct pci_func *func, struct controller *ctrl)
1386 /* Wait for SOBS to be unset */ 1386 /* Wait for SOBS to be unset */
1387 wait_for_ctrl_irq (ctrl); 1387 wait_for_ctrl_irq (ctrl);
1388 1388
1389 up(&ctrl->crit_sect); 1389 mutex_unlock(&ctrl->crit_sect);
1390 1390
1391 if (rc) 1391 if (rc)
1392 return rc; 1392 return rc;
@@ -1410,7 +1410,7 @@ static u32 board_replaced(struct pci_func *func, struct controller *ctrl)
1410 * called for the "base" bus/dev/func of an 1410 * called for the "base" bus/dev/func of an
1411 * adapter. */ 1411 * adapter. */
1412 1412
1413 down(&ctrl->crit_sect); 1413 mutex_lock(&ctrl->crit_sect);
1414 1414
1415 amber_LED_on (ctrl, hp_slot); 1415 amber_LED_on (ctrl, hp_slot);
1416 green_LED_off (ctrl, hp_slot); 1416 green_LED_off (ctrl, hp_slot);
@@ -1421,13 +1421,13 @@ static u32 board_replaced(struct pci_func *func, struct controller *ctrl)
1421 /* Wait for SOBS to be unset */ 1421 /* Wait for SOBS to be unset */
1422 wait_for_ctrl_irq (ctrl); 1422 wait_for_ctrl_irq (ctrl);
1423 1423
1424 up(&ctrl->crit_sect); 1424 mutex_unlock(&ctrl->crit_sect);
1425 1425
1426 return rc; 1426 return rc;
1427 } 1427 }
1428 /* Done configuring so turn LED on full time */ 1428 /* Done configuring so turn LED on full time */
1429 1429
1430 down(&ctrl->crit_sect); 1430 mutex_lock(&ctrl->crit_sect);
1431 1431
1432 green_LED_on (ctrl, hp_slot); 1432 green_LED_on (ctrl, hp_slot);
1433 1433
@@ -1436,7 +1436,7 @@ static u32 board_replaced(struct pci_func *func, struct controller *ctrl)
1436 /* Wait for SOBS to be unset */ 1436 /* Wait for SOBS to be unset */
1437 wait_for_ctrl_irq (ctrl); 1437 wait_for_ctrl_irq (ctrl);
1438 1438
1439 up(&ctrl->crit_sect); 1439 mutex_unlock(&ctrl->crit_sect);
1440 rc = 0; 1440 rc = 0;
1441 } else { 1441 } else {
1442 /* Something is wrong 1442 /* Something is wrong
@@ -1445,7 +1445,7 @@ static u32 board_replaced(struct pci_func *func, struct controller *ctrl)
1445 * in this case it will always be called for the "base" 1445 * in this case it will always be called for the "base"
1446 * bus/dev/func of an adapter. */ 1446 * bus/dev/func of an adapter. */
1447 1447
1448 down(&ctrl->crit_sect); 1448 mutex_lock(&ctrl->crit_sect);
1449 1449
1450 amber_LED_on (ctrl, hp_slot); 1450 amber_LED_on (ctrl, hp_slot);
1451 green_LED_off (ctrl, hp_slot); 1451 green_LED_off (ctrl, hp_slot);
@@ -1456,7 +1456,7 @@ static u32 board_replaced(struct pci_func *func, struct controller *ctrl)
1456 /* Wait for SOBS to be unset */ 1456 /* Wait for SOBS to be unset */
1457 wait_for_ctrl_irq (ctrl); 1457 wait_for_ctrl_irq (ctrl);
1458 1458
1459 up(&ctrl->crit_sect); 1459 mutex_unlock(&ctrl->crit_sect);
1460 } 1460 }
1461 1461
1462 } 1462 }
@@ -1488,7 +1488,7 @@ static u32 board_added(struct pci_func *func, struct controller *ctrl)
1488 dbg("%s: func->device, slot_offset, hp_slot = %d, %d ,%d\n", 1488 dbg("%s: func->device, slot_offset, hp_slot = %d, %d ,%d\n",
1489 __FUNCTION__, func->device, ctrl->slot_device_offset, hp_slot); 1489 __FUNCTION__, func->device, ctrl->slot_device_offset, hp_slot);
1490 1490
1491 down(&ctrl->crit_sect); 1491 mutex_lock(&ctrl->crit_sect);
1492 1492
1493 /* turn on board without attaching to the bus */ 1493 /* turn on board without attaching to the bus */
1494 enable_slot_power(ctrl, hp_slot); 1494 enable_slot_power(ctrl, hp_slot);
@@ -1522,7 +1522,7 @@ static u32 board_added(struct pci_func *func, struct controller *ctrl)
1522 /* Wait for SOBS to be unset */ 1522 /* Wait for SOBS to be unset */
1523 wait_for_ctrl_irq(ctrl); 1523 wait_for_ctrl_irq(ctrl);
1524 1524
1525 up(&ctrl->crit_sect); 1525 mutex_unlock(&ctrl->crit_sect);
1526 1526
1527 if (rc) 1527 if (rc)
1528 return rc; 1528 return rc;
@@ -1532,7 +1532,7 @@ static u32 board_added(struct pci_func *func, struct controller *ctrl)
1532 /* turn on board and blink green LED */ 1532 /* turn on board and blink green LED */
1533 1533
1534 dbg("%s: before down\n", __FUNCTION__); 1534 dbg("%s: before down\n", __FUNCTION__);
1535 down(&ctrl->crit_sect); 1535 mutex_lock(&ctrl->crit_sect);
1536 dbg("%s: after down\n", __FUNCTION__); 1536 dbg("%s: after down\n", __FUNCTION__);
1537 1537
1538 dbg("%s: before slot_enable\n", __FUNCTION__); 1538 dbg("%s: before slot_enable\n", __FUNCTION__);
@@ -1553,7 +1553,7 @@ static u32 board_added(struct pci_func *func, struct controller *ctrl)
1553 dbg("%s: after wait_for_ctrl_irq\n", __FUNCTION__); 1553 dbg("%s: after wait_for_ctrl_irq\n", __FUNCTION__);
1554 1554
1555 dbg("%s: before up\n", __FUNCTION__); 1555 dbg("%s: before up\n", __FUNCTION__);
1556 up(&ctrl->crit_sect); 1556 mutex_unlock(&ctrl->crit_sect);
1557 dbg("%s: after up\n", __FUNCTION__); 1557 dbg("%s: after up\n", __FUNCTION__);
1558 1558
1559 /* Wait for ~1 second because of hot plug spec */ 1559 /* Wait for ~1 second because of hot plug spec */
@@ -1607,7 +1607,7 @@ static u32 board_added(struct pci_func *func, struct controller *ctrl)
1607 cpqhp_resource_sort_and_combine(&(ctrl->bus_head)); 1607 cpqhp_resource_sort_and_combine(&(ctrl->bus_head));
1608 1608
1609 if (rc) { 1609 if (rc) {
1610 down(&ctrl->crit_sect); 1610 mutex_lock(&ctrl->crit_sect);
1611 1611
1612 amber_LED_on (ctrl, hp_slot); 1612 amber_LED_on (ctrl, hp_slot);
1613 green_LED_off (ctrl, hp_slot); 1613 green_LED_off (ctrl, hp_slot);
@@ -1618,7 +1618,7 @@ static u32 board_added(struct pci_func *func, struct controller *ctrl)
1618 /* Wait for SOBS to be unset */ 1618 /* Wait for SOBS to be unset */
1619 wait_for_ctrl_irq (ctrl); 1619 wait_for_ctrl_irq (ctrl);
1620 1620
1621 up(&ctrl->crit_sect); 1621 mutex_unlock(&ctrl->crit_sect);
1622 return rc; 1622 return rc;
1623 } else { 1623 } else {
1624 cpqhp_save_slot_config(ctrl, func); 1624 cpqhp_save_slot_config(ctrl, func);
@@ -1640,7 +1640,7 @@ static u32 board_added(struct pci_func *func, struct controller *ctrl)
1640 } 1640 }
1641 } while (new_slot); 1641 } while (new_slot);
1642 1642
1643 down(&ctrl->crit_sect); 1643 mutex_lock(&ctrl->crit_sect);
1644 1644
1645 green_LED_on (ctrl, hp_slot); 1645 green_LED_on (ctrl, hp_slot);
1646 1646
@@ -1649,9 +1649,9 @@ static u32 board_added(struct pci_func *func, struct controller *ctrl)
1649 /* Wait for SOBS to be unset */ 1649 /* Wait for SOBS to be unset */
1650 wait_for_ctrl_irq (ctrl); 1650 wait_for_ctrl_irq (ctrl);
1651 1651
1652 up(&ctrl->crit_sect); 1652 mutex_unlock(&ctrl->crit_sect);
1653 } else { 1653 } else {
1654 down(&ctrl->crit_sect); 1654 mutex_lock(&ctrl->crit_sect);
1655 1655
1656 amber_LED_on (ctrl, hp_slot); 1656 amber_LED_on (ctrl, hp_slot);
1657 green_LED_off (ctrl, hp_slot); 1657 green_LED_off (ctrl, hp_slot);
@@ -1662,7 +1662,7 @@ static u32 board_added(struct pci_func *func, struct controller *ctrl)
1662 /* Wait for SOBS to be unset */ 1662 /* Wait for SOBS to be unset */
1663 wait_for_ctrl_irq (ctrl); 1663 wait_for_ctrl_irq (ctrl);
1664 1664
1665 up(&ctrl->crit_sect); 1665 mutex_unlock(&ctrl->crit_sect);
1666 1666
1667 return rc; 1667 return rc;
1668 } 1668 }
@@ -1721,7 +1721,7 @@ static u32 remove_board(struct pci_func * func, u32 replace_flag, struct control
1721 func->status = 0x01; 1721 func->status = 0x01;
1722 func->configured = 0; 1722 func->configured = 0;
1723 1723
1724 down(&ctrl->crit_sect); 1724 mutex_lock(&ctrl->crit_sect);
1725 1725
1726 green_LED_off (ctrl, hp_slot); 1726 green_LED_off (ctrl, hp_slot);
1727 slot_disable (ctrl, hp_slot); 1727 slot_disable (ctrl, hp_slot);
@@ -1736,7 +1736,7 @@ static u32 remove_board(struct pci_func * func, u32 replace_flag, struct control
1736 /* Wait for SOBS to be unset */ 1736 /* Wait for SOBS to be unset */
1737 wait_for_ctrl_irq (ctrl); 1737 wait_for_ctrl_irq (ctrl);
1738 1738
1739 up(&ctrl->crit_sect); 1739 mutex_unlock(&ctrl->crit_sect);
1740 1740
1741 if (!replace_flag && ctrl->add_support) { 1741 if (!replace_flag && ctrl->add_support) {
1742 while (func) { 1742 while (func) {
@@ -1899,7 +1899,7 @@ static void interrupt_event_handler(struct controller *ctrl)
1899 dbg("button cancel\n"); 1899 dbg("button cancel\n");
1900 del_timer(&p_slot->task_event); 1900 del_timer(&p_slot->task_event);
1901 1901
1902 down(&ctrl->crit_sect); 1902 mutex_lock(&ctrl->crit_sect);
1903 1903
1904 if (p_slot->state == BLINKINGOFF_STATE) { 1904 if (p_slot->state == BLINKINGOFF_STATE) {
1905 /* slot is on */ 1905 /* slot is on */
@@ -1922,7 +1922,7 @@ static void interrupt_event_handler(struct controller *ctrl)
1922 /* Wait for SOBS to be unset */ 1922 /* Wait for SOBS to be unset */
1923 wait_for_ctrl_irq (ctrl); 1923 wait_for_ctrl_irq (ctrl);
1924 1924
1925 up(&ctrl->crit_sect); 1925 mutex_unlock(&ctrl->crit_sect);
1926 } 1926 }
1927 /*** button Released (No action on press...) */ 1927 /*** button Released (No action on press...) */
1928 else if (ctrl->event_queue[loop].event_type == INT_BUTTON_RELEASE) { 1928 else if (ctrl->event_queue[loop].event_type == INT_BUTTON_RELEASE) {
@@ -1937,7 +1937,7 @@ static void interrupt_event_handler(struct controller *ctrl)
1937 p_slot->state = BLINKINGON_STATE; 1937 p_slot->state = BLINKINGON_STATE;
1938 info(msg_button_on, p_slot->number); 1938 info(msg_button_on, p_slot->number);
1939 } 1939 }
1940 down(&ctrl->crit_sect); 1940 mutex_lock(&ctrl->crit_sect);
1941 1941
1942 dbg("blink green LED and turn off amber\n"); 1942 dbg("blink green LED and turn off amber\n");
1943 1943
@@ -1949,7 +1949,7 @@ static void interrupt_event_handler(struct controller *ctrl)
1949 /* Wait for SOBS to be unset */ 1949 /* Wait for SOBS to be unset */
1950 wait_for_ctrl_irq (ctrl); 1950 wait_for_ctrl_irq (ctrl);
1951 1951
1952 up(&ctrl->crit_sect); 1952 mutex_unlock(&ctrl->crit_sect);
1953 init_timer(&p_slot->task_event); 1953 init_timer(&p_slot->task_event);
1954 p_slot->hp_slot = hp_slot; 1954 p_slot->hp_slot = hp_slot;
1955 p_slot->ctrl = ctrl; 1955 p_slot->ctrl = ctrl;