aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/pciehp_hpc.c
diff options
context:
space:
mode:
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>2009-09-15 04:24:46 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-09-17 13:05:31 -0400
commit8720d27dabf580278a7719fa8b5783d9878e2d42 (patch)
tree229ee309a9a205f41650a01ff83c0a24b710a314 /drivers/pci/hotplug/pciehp_hpc.c
parente2d4304b7d2b85c45de89ec420037d6b9261a12d (diff)
PCI: pciehp: remove slot_list field
Since PCIe downstream port has only one slot at most, we don't need 'slot_list' linked list to manage multiple slots under the port. Acked-by: Alex Chiang <achiang@hp.com> Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/hotplug/pciehp_hpc.c')
-rw-r--r--drivers/pci/hotplug/pciehp_hpc.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index 271f917b6f2c..cb0cf2cae7b7 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -614,8 +614,8 @@ static int hpc_power_off_slot(struct slot * slot)
614static irqreturn_t pcie_isr(int irq, void *dev_id) 614static irqreturn_t pcie_isr(int irq, void *dev_id)
615{ 615{
616 struct controller *ctrl = (struct controller *)dev_id; 616 struct controller *ctrl = (struct controller *)dev_id;
617 struct slot *slot = ctrl->slot;
617 u16 detected, intr_loc; 618 u16 detected, intr_loc;
618 struct slot *p_slot;
619 619
620 /* 620 /*
621 * In order to guarantee that all interrupt events are 621 * In order to guarantee that all interrupt events are
@@ -656,24 +656,22 @@ static irqreturn_t pcie_isr(int irq, void *dev_id)
656 if (!(intr_loc & ~PCI_EXP_SLTSTA_CC)) 656 if (!(intr_loc & ~PCI_EXP_SLTSTA_CC))
657 return IRQ_HANDLED; 657 return IRQ_HANDLED;
658 658
659 p_slot = pciehp_find_slot(ctrl, ctrl->slot_device_offset);
660
661 /* Check MRL Sensor Changed */ 659 /* Check MRL Sensor Changed */
662 if (intr_loc & PCI_EXP_SLTSTA_MRLSC) 660 if (intr_loc & PCI_EXP_SLTSTA_MRLSC)
663 pciehp_handle_switch_change(p_slot); 661 pciehp_handle_switch_change(slot);
664 662
665 /* Check Attention Button Pressed */ 663 /* Check Attention Button Pressed */
666 if (intr_loc & PCI_EXP_SLTSTA_ABP) 664 if (intr_loc & PCI_EXP_SLTSTA_ABP)
667 pciehp_handle_attention_button(p_slot); 665 pciehp_handle_attention_button(slot);
668 666
669 /* Check Presence Detect Changed */ 667 /* Check Presence Detect Changed */
670 if (intr_loc & PCI_EXP_SLTSTA_PDC) 668 if (intr_loc & PCI_EXP_SLTSTA_PDC)
671 pciehp_handle_presence_change(p_slot); 669 pciehp_handle_presence_change(slot);
672 670
673 /* Check Power Fault Detected */ 671 /* Check Power Fault Detected */
674 if ((intr_loc & PCI_EXP_SLTSTA_PFD) && !ctrl->power_fault_detected) { 672 if ((intr_loc & PCI_EXP_SLTSTA_PFD) && !ctrl->power_fault_detected) {
675 ctrl->power_fault_detected = 1; 673 ctrl->power_fault_detected = 1;
676 pciehp_handle_power_fault(p_slot); 674 pciehp_handle_power_fault(slot);
677 } 675 }
678 return IRQ_HANDLED; 676 return IRQ_HANDLED;
679} 677}
@@ -938,15 +936,13 @@ static int pcie_init_slot(struct controller *ctrl)
938 slot->number = ctrl->first_slot; 936 slot->number = ctrl->first_slot;
939 mutex_init(&slot->lock); 937 mutex_init(&slot->lock);
940 INIT_DELAYED_WORK(&slot->work, pciehp_queue_pushbutton_work); 938 INIT_DELAYED_WORK(&slot->work, pciehp_queue_pushbutton_work);
941 list_add(&slot->slot_list, &ctrl->slot_list); 939 ctrl->slot = slot;
942 return 0; 940 return 0;
943} 941}
944 942
945static void pcie_cleanup_slot(struct controller *ctrl) 943static void pcie_cleanup_slot(struct controller *ctrl)
946{ 944{
947 struct slot *slot; 945 struct slot *slot = ctrl->slot;
948 slot = list_first_entry(&ctrl->slot_list, struct slot, slot_list);
949 list_del(&slot->slot_list);
950 cancel_delayed_work(&slot->work); 946 cancel_delayed_work(&slot->work);
951 flush_scheduled_work(); 947 flush_scheduled_work();
952 flush_workqueue(pciehp_wq); 948 flush_workqueue(pciehp_wq);
@@ -1014,8 +1010,6 @@ struct controller *pcie_init(struct pcie_device *dev)
1014 dev_err(&dev->device, "%s: Out of memory\n", __func__); 1010 dev_err(&dev->device, "%s: Out of memory\n", __func__);
1015 goto abort; 1011 goto abort;
1016 } 1012 }
1017 INIT_LIST_HEAD(&ctrl->slot_list);
1018
1019 ctrl->pcie = dev; 1013 ctrl->pcie = dev;
1020 ctrl->pci_dev = pdev; 1014 ctrl->pci_dev = pdev;
1021 ctrl->cap_base = pci_find_capability(pdev, PCI_CAP_ID_EXP); 1015 ctrl->cap_base = pci_find_capability(pdev, PCI_CAP_ID_EXP);