diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/hotplug/pciehp.h | 2 | ||||
-rw-r--r-- | drivers/pci/hotplug/pciehp_hpc.c | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h index 979212d5d755..0159960dbadc 100644 --- a/drivers/pci/hotplug/pciehp.h +++ b/drivers/pci/hotplug/pciehp.h | |||
@@ -95,7 +95,6 @@ struct controller { | |||
95 | struct slot *slot; | 95 | struct slot *slot; |
96 | struct hpc_ops *hpc_ops; | 96 | struct hpc_ops *hpc_ops; |
97 | wait_queue_head_t queue; /* sleep & wake process */ | 97 | wait_queue_head_t queue; /* sleep & wake process */ |
98 | u32 first_slot; /* First physical slot number */ /* PCIE only has 1 slot */ | ||
99 | u8 slot_bus; /* Bus where the slots handled by this controller sit */ | 98 | u8 slot_bus; /* Bus where the slots handled by this controller sit */ |
100 | u32 slot_cap; | 99 | u32 slot_cap; |
101 | u8 cap_base; | 100 | u8 cap_base; |
@@ -153,6 +152,7 @@ struct controller { | |||
153 | #define HP_SUPR_RM(ctrl) ((ctrl)->slot_cap & HP_SUPR_RM_SUP) | 152 | #define HP_SUPR_RM(ctrl) ((ctrl)->slot_cap & HP_SUPR_RM_SUP) |
154 | #define EMI(ctrl) ((ctrl)->slot_cap & EMI_PRSN) | 153 | #define EMI(ctrl) ((ctrl)->slot_cap & EMI_PRSN) |
155 | #define NO_CMD_CMPL(ctrl) ((ctrl)->slot_cap & NO_CMD_CMPL_SUP) | 154 | #define NO_CMD_CMPL(ctrl) ((ctrl)->slot_cap & NO_CMD_CMPL_SUP) |
155 | #define PSN(ctrl) ((ctrl)->slot_cap >> 19) | ||
156 | 156 | ||
157 | extern int pciehp_sysfs_enable_slot(struct slot *slot); | 157 | extern int pciehp_sysfs_enable_slot(struct slot *slot); |
158 | extern int pciehp_sysfs_disable_slot(struct slot *slot); | 158 | extern int pciehp_sysfs_disable_slot(struct slot *slot); |
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 53118c12bc09..7374029316ec 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c | |||
@@ -926,7 +926,7 @@ static int pcie_init_slot(struct controller *ctrl) | |||
926 | 926 | ||
927 | slot->ctrl = ctrl; | 927 | slot->ctrl = ctrl; |
928 | slot->hpc_ops = ctrl->hpc_ops; | 928 | slot->hpc_ops = ctrl->hpc_ops; |
929 | slot->number = ctrl->first_slot; | 929 | slot->number = PSN(ctrl); |
930 | mutex_init(&slot->lock); | 930 | mutex_init(&slot->lock); |
931 | INIT_DELAYED_WORK(&slot->work, pciehp_queue_pushbutton_work); | 931 | INIT_DELAYED_WORK(&slot->work, pciehp_queue_pushbutton_work); |
932 | ctrl->slot = slot; | 932 | ctrl->slot = slot; |
@@ -969,7 +969,7 @@ static inline void dbg_ctrl(struct controller *ctrl) | |||
969 | (unsigned long long)pci_resource_start(pdev, i)); | 969 | (unsigned long long)pci_resource_start(pdev, i)); |
970 | } | 970 | } |
971 | ctrl_info(ctrl, "Slot Capabilities : 0x%08x\n", ctrl->slot_cap); | 971 | ctrl_info(ctrl, "Slot Capabilities : 0x%08x\n", ctrl->slot_cap); |
972 | ctrl_info(ctrl, " Physical Slot Number : %d\n", ctrl->first_slot); | 972 | ctrl_info(ctrl, " Physical Slot Number : %d\n", PSN(ctrl)); |
973 | ctrl_info(ctrl, " Attention Button : %3s\n", | 973 | ctrl_info(ctrl, " Attention Button : %3s\n", |
974 | ATTN_BUTTN(ctrl) ? "yes" : "no"); | 974 | ATTN_BUTTN(ctrl) ? "yes" : "no"); |
975 | ctrl_info(ctrl, " Power Controller : %3s\n", | 975 | ctrl_info(ctrl, " Power Controller : %3s\n", |
@@ -1016,7 +1016,6 @@ struct controller *pcie_init(struct pcie_device *dev) | |||
1016 | } | 1016 | } |
1017 | 1017 | ||
1018 | ctrl->slot_cap = slot_cap; | 1018 | ctrl->slot_cap = slot_cap; |
1019 | ctrl->first_slot = slot_cap >> 19; | ||
1020 | ctrl->hpc_ops = &pciehp_hpc_ops; | 1019 | ctrl->hpc_ops = &pciehp_hpc_ops; |
1021 | mutex_init(&ctrl->crit_sect); | 1020 | mutex_init(&ctrl->crit_sect); |
1022 | mutex_init(&ctrl->ctrl_lock); | 1021 | mutex_init(&ctrl->ctrl_lock); |