diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/hotplug/shpchp.h | 6 | ||||
-rw-r--r-- | drivers/pci/hotplug/shpchp_core.c | 26 |
2 files changed, 1 insertions, 31 deletions
diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h index f036485cd9ec..e21714982476 100644 --- a/drivers/pci/hotplug/shpchp.h +++ b/drivers/pci/hotplug/shpchp.h | |||
@@ -89,15 +89,9 @@ struct controller { | |||
89 | struct list_head slot_list; | 89 | struct list_head slot_list; |
90 | struct hpc_ops *hpc_ops; | 90 | struct hpc_ops *hpc_ops; |
91 | wait_queue_head_t queue; /* sleep & wake process */ | 91 | wait_queue_head_t queue; /* sleep & wake process */ |
92 | u8 bus; | ||
93 | u8 device; | ||
94 | u8 function; | ||
95 | u8 slot_device_offset; | 92 | u8 slot_device_offset; |
96 | u8 add_support; | ||
97 | u32 pcix_misc2_reg; /* for amd pogo errata */ | 93 | u32 pcix_misc2_reg; /* for amd pogo errata */ |
98 | enum pci_bus_speed speed; | ||
99 | u32 first_slot; /* First physical slot number */ | 94 | u32 first_slot; /* First physical slot number */ |
100 | u8 slot_bus; /* Bus where the slots handled by this controller sit */ | ||
101 | u32 cap_offset; | 95 | u32 cap_offset; |
102 | unsigned long mmio_base; | 96 | unsigned long mmio_base; |
103 | unsigned long mmio_size; | 97 | unsigned long mmio_size; |
diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c index 68471dd49f7e..b64999d59f57 100644 --- a/drivers/pci/hotplug/shpchp_core.c +++ b/drivers/pci/hotplug/shpchp_core.c | |||
@@ -149,7 +149,7 @@ static int init_slots(struct controller *ctrl) | |||
149 | 149 | ||
150 | slot->hp_slot = i; | 150 | slot->hp_slot = i; |
151 | slot->ctrl = ctrl; | 151 | slot->ctrl = ctrl; |
152 | slot->bus = ctrl->slot_bus; | 152 | slot->bus = ctrl->pci_dev->subordinate->number; |
153 | slot->device = ctrl->slot_device_offset + i; | 153 | slot->device = ctrl->slot_device_offset + i; |
154 | slot->hpc_ops = ctrl->hpc_ops; | 154 | slot->hpc_ops = ctrl->hpc_ops; |
155 | mutex_init(&slot->lock); | 155 | mutex_init(&slot->lock); |
@@ -355,7 +355,6 @@ static int shpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
355 | { | 355 | { |
356 | int rc; | 356 | int rc; |
357 | struct controller *ctrl; | 357 | struct controller *ctrl; |
358 | struct slot *t_slot; | ||
359 | 358 | ||
360 | if (!is_shpc_capable(pdev)) | 359 | if (!is_shpc_capable(pdev)) |
361 | return -ENODEV; | 360 | return -ENODEV; |
@@ -376,16 +375,6 @@ static int shpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
376 | 375 | ||
377 | pci_set_drvdata(pdev, ctrl); | 376 | pci_set_drvdata(pdev, ctrl); |
378 | 377 | ||
379 | ctrl->bus = pdev->bus->number; | ||
380 | ctrl->slot_bus = pdev->subordinate->number; | ||
381 | ctrl->device = PCI_SLOT(pdev->devfn); | ||
382 | ctrl->function = PCI_FUNC(pdev->devfn); | ||
383 | |||
384 | dbg("ctrl bus=0x%x, device=%x, function=%x, irq=%x\n", | ||
385 | ctrl->bus, ctrl->device, ctrl->function, pdev->irq); | ||
386 | |||
387 | ctrl->add_support = 1; | ||
388 | |||
389 | /* Setup the slot information structures */ | 378 | /* Setup the slot information structures */ |
390 | rc = init_slots(ctrl); | 379 | rc = init_slots(ctrl); |
391 | if (rc) { | 380 | if (rc) { |
@@ -393,19 +382,6 @@ static int shpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
393 | goto err_out_release_ctlr; | 382 | goto err_out_release_ctlr; |
394 | } | 383 | } |
395 | 384 | ||
396 | /* Now hpc_functions (slot->hpc_ops->functions) are ready */ | ||
397 | t_slot = shpchp_find_slot(ctrl, ctrl->slot_device_offset); | ||
398 | |||
399 | /* Check for operation bus speed */ | ||
400 | rc = t_slot->hpc_ops->get_cur_bus_speed(t_slot, &ctrl->speed); | ||
401 | dbg("%s: t_slot->hp_slot %x\n", __FUNCTION__,t_slot->hp_slot); | ||
402 | |||
403 | if (rc || ctrl->speed == PCI_SPEED_UNKNOWN) { | ||
404 | err(SHPC_MODULE_NAME ": Can't get current bus speed. " | ||
405 | "Set to 33MHz PCI.\n"); | ||
406 | ctrl->speed = PCI_SPEED_33MHz; | ||
407 | } | ||
408 | |||
409 | rc = shpchp_create_ctrl_files(ctrl); | 385 | rc = shpchp_create_ctrl_files(ctrl); |
410 | if (rc) | 386 | if (rc) |
411 | goto err_cleanup_slots; | 387 | goto err_cleanup_slots; |