diff options
Diffstat (limited to 'drivers/pci/hotplug/shpchp_core.c')
-rw-r--r-- | drivers/pci/hotplug/shpchp_core.c | 45 |
1 files changed, 1 insertions, 44 deletions
diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c index 4eac85b3d90e..68471dd49f7e 100644 --- a/drivers/pci/hotplug/shpchp_core.c +++ b/drivers/pci/hotplug/shpchp_core.c | |||
@@ -211,36 +211,6 @@ void cleanup_slots(struct controller *ctrl) | |||
211 | } | 211 | } |
212 | } | 212 | } |
213 | 213 | ||
214 | static int get_ctlr_slot_config(struct controller *ctrl) | ||
215 | { | ||
216 | int num_ctlr_slots; | ||
217 | int first_device_num; | ||
218 | int physical_slot_num; | ||
219 | int updown; | ||
220 | int rc; | ||
221 | int flags; | ||
222 | |||
223 | rc = shpc_get_ctlr_slot_config(ctrl, &num_ctlr_slots, | ||
224 | &first_device_num, &physical_slot_num, | ||
225 | &updown, &flags); | ||
226 | if (rc) { | ||
227 | err("%s: get_ctlr_slot_config fail for b:d (%x:%x)\n", | ||
228 | __FUNCTION__, ctrl->bus, ctrl->device); | ||
229 | return -1; | ||
230 | } | ||
231 | |||
232 | ctrl->num_slots = num_ctlr_slots; | ||
233 | ctrl->slot_device_offset = first_device_num; | ||
234 | ctrl->first_slot = physical_slot_num; | ||
235 | ctrl->slot_num_inc = updown; /* either -1 or 1 */ | ||
236 | |||
237 | dbg("%s: num_slot(0x%x) 1st_dev(0x%x) psn(0x%x) updown(%d) for b:d " | ||
238 | "(%x:%x)\n", __FUNCTION__, num_ctlr_slots, first_device_num, | ||
239 | physical_slot_num, updown, ctrl->bus, ctrl->device); | ||
240 | |||
241 | return 0; | ||
242 | } | ||
243 | |||
244 | /* | 214 | /* |
245 | * set_attention_status - Turns the Amber LED for a slot on, off or blink | 215 | * set_attention_status - Turns the Amber LED for a slot on, off or blink |
246 | */ | 216 | */ |
@@ -386,8 +356,6 @@ static int shpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
386 | int rc; | 356 | int rc; |
387 | struct controller *ctrl; | 357 | struct controller *ctrl; |
388 | struct slot *t_slot; | 358 | struct slot *t_slot; |
389 | int first_device_num; /* first PCI device number */ | ||
390 | int num_ctlr_slots; /* number of slots implemented */ | ||
391 | 359 | ||
392 | if (!is_shpc_capable(pdev)) | 360 | if (!is_shpc_capable(pdev)) |
393 | return -ENODEV; | 361 | return -ENODEV; |
@@ -416,17 +384,6 @@ static int shpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
416 | dbg("ctrl bus=0x%x, device=%x, function=%x, irq=%x\n", | 384 | dbg("ctrl bus=0x%x, device=%x, function=%x, irq=%x\n", |
417 | ctrl->bus, ctrl->device, ctrl->function, pdev->irq); | 385 | ctrl->bus, ctrl->device, ctrl->function, pdev->irq); |
418 | 386 | ||
419 | /* | ||
420 | * Save configuration headers for this and subordinate PCI buses | ||
421 | */ | ||
422 | rc = get_ctlr_slot_config(ctrl); | ||
423 | if (rc) { | ||
424 | err(msg_initialization_err, rc); | ||
425 | goto err_out_release_ctlr; | ||
426 | } | ||
427 | first_device_num = ctrl->slot_device_offset; | ||
428 | num_ctlr_slots = ctrl->num_slots; | ||
429 | |||
430 | ctrl->add_support = 1; | 387 | ctrl->add_support = 1; |
431 | 388 | ||
432 | /* Setup the slot information structures */ | 389 | /* Setup the slot information structures */ |
@@ -437,7 +394,7 @@ static int shpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
437 | } | 394 | } |
438 | 395 | ||
439 | /* Now hpc_functions (slot->hpc_ops->functions) are ready */ | 396 | /* Now hpc_functions (slot->hpc_ops->functions) are ready */ |
440 | t_slot = shpchp_find_slot(ctrl, first_device_num); | 397 | t_slot = shpchp_find_slot(ctrl, ctrl->slot_device_offset); |
441 | 398 | ||
442 | /* Check for operation bus speed */ | 399 | /* Check for operation bus speed */ |
443 | rc = t_slot->hpc_ops->get_cur_bus_speed(t_slot, &ctrl->speed); | 400 | rc = t_slot->hpc_ops->get_cur_bus_speed(t_slot, &ctrl->speed); |