diff options
author | Alex Chiang <achiang@hp.com> | 2008-10-20 19:41:38 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2008-10-22 19:42:42 -0400 |
commit | e1acb24f059defdaa0264e925f19cc21b0a3e592 (patch) | |
tree | 9758cc4da2cab89d54c5c3a58eb9b978ad4b45c0 /drivers/pci/hotplug/pciehp_ctrl.c | |
parent | a32615a1a661f83661e8a26c3bc7763f716da8f3 (diff) |
PCI: pciehp: remove 'name' parameter
We do not need to manage our own name parameter, especially since
the PCI core can change it on our behalf, in the case of duplicate
slot names.
Remove 'name' from pciehp's version of struct slot, and remove
unused 'task_list' as well.
Cc: kristen.c.accardi@intel.com
Acked-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/hotplug/pciehp_ctrl.c')
-rw-r--r-- | drivers/pci/hotplug/pciehp_ctrl.c | 53 |
1 files changed, 29 insertions, 24 deletions
diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c index acb7f9efd182..cce6e5f659e8 100644 --- a/drivers/pci/hotplug/pciehp_ctrl.c +++ b/drivers/pci/hotplug/pciehp_ctrl.c | |||
@@ -66,7 +66,7 @@ u8 pciehp_handle_attention_button(struct slot *p_slot) | |||
66 | /* | 66 | /* |
67 | * Button pressed - See if need to TAKE ACTION!!! | 67 | * Button pressed - See if need to TAKE ACTION!!! |
68 | */ | 68 | */ |
69 | ctrl_info(ctrl, "Button pressed on Slot(%s)\n", p_slot->name); | 69 | ctrl_info(ctrl, "Button pressed on Slot(%s)\n", slot_name(p_slot)); |
70 | event_type = INT_BUTTON_PRESS; | 70 | event_type = INT_BUTTON_PRESS; |
71 | 71 | ||
72 | queue_interrupt_event(p_slot, event_type); | 72 | queue_interrupt_event(p_slot, event_type); |
@@ -88,13 +88,13 @@ u8 pciehp_handle_switch_change(struct slot *p_slot) | |||
88 | /* | 88 | /* |
89 | * Switch opened | 89 | * Switch opened |
90 | */ | 90 | */ |
91 | ctrl_info(ctrl, "Latch open on Slot(%s)\n", p_slot->name); | 91 | ctrl_info(ctrl, "Latch open on Slot(%s)\n", slot_name(p_slot)); |
92 | event_type = INT_SWITCH_OPEN; | 92 | event_type = INT_SWITCH_OPEN; |
93 | } else { | 93 | } else { |
94 | /* | 94 | /* |
95 | * Switch closed | 95 | * Switch closed |
96 | */ | 96 | */ |
97 | ctrl_info(ctrl, "Latch close on Slot(%s)\n", p_slot->name); | 97 | ctrl_info(ctrl, "Latch close on Slot(%s)\n", slot_name(p_slot)); |
98 | event_type = INT_SWITCH_CLOSE; | 98 | event_type = INT_SWITCH_CLOSE; |
99 | } | 99 | } |
100 | 100 | ||
@@ -120,13 +120,14 @@ u8 pciehp_handle_presence_change(struct slot *p_slot) | |||
120 | /* | 120 | /* |
121 | * Card Present | 121 | * Card Present |
122 | */ | 122 | */ |
123 | ctrl_info(ctrl, "Card present on Slot(%s)\n", p_slot->name); | 123 | ctrl_info(ctrl, "Card present on Slot(%s)\n", slot_name(p_slot)); |
124 | event_type = INT_PRESENCE_ON; | 124 | event_type = INT_PRESENCE_ON; |
125 | } else { | 125 | } else { |
126 | /* | 126 | /* |
127 | * Not Present | 127 | * Not Present |
128 | */ | 128 | */ |
129 | ctrl_info(ctrl, "Card not present on Slot(%s)\n", p_slot->name); | 129 | ctrl_info(ctrl, "Card not present on Slot(%s)\n", |
130 | slot_name(p_slot)); | ||
130 | event_type = INT_PRESENCE_OFF; | 131 | event_type = INT_PRESENCE_OFF; |
131 | } | 132 | } |
132 | 133 | ||
@@ -148,13 +149,13 @@ u8 pciehp_handle_power_fault(struct slot *p_slot) | |||
148 | * power fault Cleared | 149 | * power fault Cleared |
149 | */ | 150 | */ |
150 | ctrl_info(ctrl, "Power fault cleared on Slot(%s)\n", | 151 | ctrl_info(ctrl, "Power fault cleared on Slot(%s)\n", |
151 | p_slot->name); | 152 | slot_name(p_slot)); |
152 | event_type = INT_POWER_FAULT_CLEAR; | 153 | event_type = INT_POWER_FAULT_CLEAR; |
153 | } else { | 154 | } else { |
154 | /* | 155 | /* |
155 | * power fault | 156 | * power fault |
156 | */ | 157 | */ |
157 | ctrl_info(ctrl, "Power fault on Slot(%s)\n", p_slot->name); | 158 | ctrl_info(ctrl, "Power fault on Slot(%s)\n", slot_name(p_slot)); |
158 | event_type = INT_POWER_FAULT; | 159 | event_type = INT_POWER_FAULT; |
159 | ctrl_info(ctrl, "power fault bit %x set\n", 0); | 160 | ctrl_info(ctrl, "power fault bit %x set\n", 0); |
160 | } | 161 | } |
@@ -412,12 +413,12 @@ static void handle_button_press_event(struct slot *p_slot) | |||
412 | p_slot->state = BLINKINGOFF_STATE; | 413 | p_slot->state = BLINKINGOFF_STATE; |
413 | ctrl_info(ctrl, | 414 | ctrl_info(ctrl, |
414 | "PCI slot #%s - powering off due to button " | 415 | "PCI slot #%s - powering off due to button " |
415 | "press.\n", p_slot->name); | 416 | "press.\n", slot_name(p_slot)); |
416 | } else { | 417 | } else { |
417 | p_slot->state = BLINKINGON_STATE; | 418 | p_slot->state = BLINKINGON_STATE; |
418 | ctrl_info(ctrl, | 419 | ctrl_info(ctrl, |
419 | "PCI slot #%s - powering on due to button " | 420 | "PCI slot #%s - powering on due to button " |
420 | "press.\n", p_slot->name); | 421 | "press.\n", slot_name(p_slot)); |
421 | } | 422 | } |
422 | /* blink green LED and turn off amber */ | 423 | /* blink green LED and turn off amber */ |
423 | if (PWR_LED(ctrl)) | 424 | if (PWR_LED(ctrl)) |
@@ -434,7 +435,7 @@ static void handle_button_press_event(struct slot *p_slot) | |||
434 | * press the attention again before the 5 sec. limit | 435 | * press the attention again before the 5 sec. limit |
435 | * expires to cancel hot-add or hot-remove | 436 | * expires to cancel hot-add or hot-remove |
436 | */ | 437 | */ |
437 | ctrl_info(ctrl, "Button cancel on Slot(%s)\n", p_slot->name); | 438 | ctrl_info(ctrl, "Button cancel on Slot(%s)\n", slot_name(p_slot)); |
438 | ctrl_dbg(ctrl, "%s: button cancel\n", __func__); | 439 | ctrl_dbg(ctrl, "%s: button cancel\n", __func__); |
439 | cancel_delayed_work(&p_slot->work); | 440 | cancel_delayed_work(&p_slot->work); |
440 | if (p_slot->state == BLINKINGOFF_STATE) { | 441 | if (p_slot->state == BLINKINGOFF_STATE) { |
@@ -447,7 +448,7 @@ static void handle_button_press_event(struct slot *p_slot) | |||
447 | if (ATTN_LED(ctrl)) | 448 | if (ATTN_LED(ctrl)) |
448 | p_slot->hpc_ops->set_attention_status(p_slot, 0); | 449 | p_slot->hpc_ops->set_attention_status(p_slot, 0); |
449 | ctrl_info(ctrl, "PCI slot #%s - action canceled " | 450 | ctrl_info(ctrl, "PCI slot #%s - action canceled " |
450 | "due to button press\n", p_slot->name); | 451 | "due to button press\n", slot_name(p_slot)); |
451 | p_slot->state = STATIC_STATE; | 452 | p_slot->state = STATIC_STATE; |
452 | break; | 453 | break; |
453 | case POWEROFF_STATE: | 454 | case POWEROFF_STATE: |
@@ -457,7 +458,7 @@ static void handle_button_press_event(struct slot *p_slot) | |||
457 | * this means that the previous attention button action | 458 | * this means that the previous attention button action |
458 | * to hot-add or hot-remove is undergoing | 459 | * to hot-add or hot-remove is undergoing |
459 | */ | 460 | */ |
460 | ctrl_info(ctrl, "Button ignore on Slot(%s)\n", p_slot->name); | 461 | ctrl_info(ctrl, "Button ignore on Slot(%s)\n", slot_name(p_slot)); |
461 | update_slot_info(p_slot); | 462 | update_slot_info(p_slot); |
462 | break; | 463 | break; |
463 | default: | 464 | default: |
@@ -540,7 +541,7 @@ int pciehp_enable_slot(struct slot *p_slot) | |||
540 | rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); | 541 | rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); |
541 | if (rc || !getstatus) { | 542 | if (rc || !getstatus) { |
542 | ctrl_info(ctrl, "%s: no adapter on slot(%s)\n", | 543 | ctrl_info(ctrl, "%s: no adapter on slot(%s)\n", |
543 | __func__, p_slot->name); | 544 | __func__, slot_name(p_slot)); |
544 | mutex_unlock(&p_slot->ctrl->crit_sect); | 545 | mutex_unlock(&p_slot->ctrl->crit_sect); |
545 | return -ENODEV; | 546 | return -ENODEV; |
546 | } | 547 | } |
@@ -548,7 +549,7 @@ int pciehp_enable_slot(struct slot *p_slot) | |||
548 | rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); | 549 | rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); |
549 | if (rc || getstatus) { | 550 | if (rc || getstatus) { |
550 | ctrl_info(ctrl, "%s: latch open on slot(%s)\n", | 551 | ctrl_info(ctrl, "%s: latch open on slot(%s)\n", |
551 | __func__, p_slot->name); | 552 | __func__, slot_name(p_slot)); |
552 | mutex_unlock(&p_slot->ctrl->crit_sect); | 553 | mutex_unlock(&p_slot->ctrl->crit_sect); |
553 | return -ENODEV; | 554 | return -ENODEV; |
554 | } | 555 | } |
@@ -558,7 +559,7 @@ int pciehp_enable_slot(struct slot *p_slot) | |||
558 | rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); | 559 | rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); |
559 | if (rc || getstatus) { | 560 | if (rc || getstatus) { |
560 | ctrl_info(ctrl, "%s: already enabled on slot(%s)\n", | 561 | ctrl_info(ctrl, "%s: already enabled on slot(%s)\n", |
561 | __func__, p_slot->name); | 562 | __func__, slot_name(p_slot)); |
562 | mutex_unlock(&p_slot->ctrl->crit_sect); | 563 | mutex_unlock(&p_slot->ctrl->crit_sect); |
563 | return -EINVAL; | 564 | return -EINVAL; |
564 | } | 565 | } |
@@ -594,7 +595,7 @@ int pciehp_disable_slot(struct slot *p_slot) | |||
594 | ret = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); | 595 | ret = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); |
595 | if (ret || !getstatus) { | 596 | if (ret || !getstatus) { |
596 | ctrl_info(ctrl, "%s: no adapter on slot(%s)\n", | 597 | ctrl_info(ctrl, "%s: no adapter on slot(%s)\n", |
597 | __func__, p_slot->name); | 598 | __func__, slot_name(p_slot)); |
598 | mutex_unlock(&p_slot->ctrl->crit_sect); | 599 | mutex_unlock(&p_slot->ctrl->crit_sect); |
599 | return -ENODEV; | 600 | return -ENODEV; |
600 | } | 601 | } |
@@ -604,7 +605,7 @@ int pciehp_disable_slot(struct slot *p_slot) | |||
604 | ret = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); | 605 | ret = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); |
605 | if (ret || getstatus) { | 606 | if (ret || getstatus) { |
606 | ctrl_info(ctrl, "%s: latch open on slot(%s)\n", | 607 | ctrl_info(ctrl, "%s: latch open on slot(%s)\n", |
607 | __func__, p_slot->name); | 608 | __func__, slot_name(p_slot)); |
608 | mutex_unlock(&p_slot->ctrl->crit_sect); | 609 | mutex_unlock(&p_slot->ctrl->crit_sect); |
609 | return -ENODEV; | 610 | return -ENODEV; |
610 | } | 611 | } |
@@ -614,7 +615,7 @@ int pciehp_disable_slot(struct slot *p_slot) | |||
614 | ret = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); | 615 | ret = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); |
615 | if (ret || !getstatus) { | 616 | if (ret || !getstatus) { |
616 | ctrl_info(ctrl, "%s: already disabled slot(%s)\n", | 617 | ctrl_info(ctrl, "%s: already disabled slot(%s)\n", |
617 | __func__, p_slot->name); | 618 | __func__, slot_name(p_slot)); |
618 | mutex_unlock(&p_slot->ctrl->crit_sect); | 619 | mutex_unlock(&p_slot->ctrl->crit_sect); |
619 | return -EINVAL; | 620 | return -EINVAL; |
620 | } | 621 | } |
@@ -645,14 +646,16 @@ int pciehp_sysfs_enable_slot(struct slot *p_slot) | |||
645 | break; | 646 | break; |
646 | case POWERON_STATE: | 647 | case POWERON_STATE: |
647 | ctrl_info(ctrl, "Slot %s is already in powering on state\n", | 648 | ctrl_info(ctrl, "Slot %s is already in powering on state\n", |
648 | p_slot->name); | 649 | slot_name(p_slot)); |
649 | break; | 650 | break; |
650 | case BLINKINGOFF_STATE: | 651 | case BLINKINGOFF_STATE: |
651 | case POWEROFF_STATE: | 652 | case POWEROFF_STATE: |
652 | ctrl_info(ctrl, "Already enabled on slot %s\n", p_slot->name); | 653 | ctrl_info(ctrl, "Already enabled on slot %s\n", |
654 | slot_name(p_slot)); | ||
653 | break; | 655 | break; |
654 | default: | 656 | default: |
655 | ctrl_err(ctrl, "Not a valid state on slot %s\n", p_slot->name); | 657 | ctrl_err(ctrl, "Not a valid state on slot %s\n", |
658 | slot_name(p_slot)); | ||
656 | break; | 659 | break; |
657 | } | 660 | } |
658 | mutex_unlock(&p_slot->lock); | 661 | mutex_unlock(&p_slot->lock); |
@@ -678,14 +681,16 @@ int pciehp_sysfs_disable_slot(struct slot *p_slot) | |||
678 | break; | 681 | break; |
679 | case POWEROFF_STATE: | 682 | case POWEROFF_STATE: |
680 | ctrl_info(ctrl, "Slot %s is already in powering off state\n", | 683 | ctrl_info(ctrl, "Slot %s is already in powering off state\n", |
681 | p_slot->name); | 684 | slot_name(p_slot)); |
682 | break; | 685 | break; |
683 | case BLINKINGON_STATE: | 686 | case BLINKINGON_STATE: |
684 | case POWERON_STATE: | 687 | case POWERON_STATE: |
685 | ctrl_info(ctrl, "Already disabled on slot %s\n", p_slot->name); | 688 | ctrl_info(ctrl, "Already disabled on slot %s\n", |
689 | slot_name(p_slot)); | ||
686 | break; | 690 | break; |
687 | default: | 691 | default: |
688 | ctrl_err(ctrl, "Not a valid state on slot %s\n", p_slot->name); | 692 | ctrl_err(ctrl, "Not a valid state on slot %s\n", |
693 | slot_name(p_slot)); | ||
689 | break; | 694 | break; |
690 | } | 695 | } |
691 | mutex_unlock(&p_slot->lock); | 696 | mutex_unlock(&p_slot->lock); |