aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/hotplug/shpchp_core.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c
index b64999d59f57..24d1afa4cf97 100644
--- a/drivers/pci/hotplug/shpchp_core.c
+++ b/drivers/pci/hotplug/shpchp_core.c
@@ -104,23 +104,6 @@ static void make_slot_name(struct slot *slot)
104 slot->bus, slot->number); 104 slot->bus, slot->number);
105} 105}
106 106
107
108
109
110static int
111shpchprm_get_physical_slot_number(struct controller *ctrl, u32 *sun,
112 u8 busnum, u8 devnum)
113{
114 int offset = devnum - ctrl->slot_device_offset;
115
116 dbg("%s: ctrl->slot_num_inc %d, offset %d\n", __FUNCTION__,
117 ctrl->slot_num_inc, offset);
118 *sun = (u8) (ctrl->first_slot + ctrl->slot_num_inc *offset);
119 return 0;
120}
121
122
123
124static int init_slots(struct controller *ctrl) 107static int init_slots(struct controller *ctrl)
125{ 108{
126 struct slot *slot; 109 struct slot *slot;
@@ -128,7 +111,6 @@ static int init_slots(struct controller *ctrl)
128 struct hotplug_slot_info *info; 111 struct hotplug_slot_info *info;
129 int retval = -ENOMEM; 112 int retval = -ENOMEM;
130 int i; 113 int i;
131 u32 sun;
132 114
133 for (i = 0; i < ctrl->num_slots; i++) { 115 for (i = 0; i < ctrl->num_slots; i++) {
134 slot = kzalloc(sizeof(*slot), GFP_KERNEL); 116 slot = kzalloc(sizeof(*slot), GFP_KERNEL);
@@ -152,13 +134,8 @@ static int init_slots(struct controller *ctrl)
152 slot->bus = ctrl->pci_dev->subordinate->number; 134 slot->bus = ctrl->pci_dev->subordinate->number;
153 slot->device = ctrl->slot_device_offset + i; 135 slot->device = ctrl->slot_device_offset + i;
154 slot->hpc_ops = ctrl->hpc_ops; 136 slot->hpc_ops = ctrl->hpc_ops;
137 slot->number = ctrl->first_slot + (ctrl->slot_num_inc * i);
155 mutex_init(&slot->lock); 138 mutex_init(&slot->lock);
156
157 if (shpchprm_get_physical_slot_number(ctrl, &sun,
158 slot->bus, slot->device))
159 goto error_info;
160
161 slot->number = sun;
162 INIT_DELAYED_WORK(&slot->work, queue_pushbutton_work); 139 INIT_DELAYED_WORK(&slot->work, queue_pushbutton_work);
163 140
164 /* register this slot with the hotplug pci core */ 141 /* register this slot with the hotplug pci core */