diff options
| -rw-r--r-- | drivers/acpi/pci_root.c | 8 | ||||
| -rw-r--r-- | drivers/acpi/pci_slot.c | 11 | ||||
| -rw-r--r-- | drivers/pci/hotplug/acpiphp_glue.c | 12 | ||||
| -rw-r--r-- | include/linux/acpi.h | 4 |
4 files changed, 19 insertions, 16 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index d710585e4a7f..2868a9ff6d07 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c | |||
| @@ -87,7 +87,7 @@ int acpi_pci_register_driver(struct acpi_pci_driver *driver) | |||
| 87 | list_add_tail(&driver->node, &acpi_pci_drivers); | 87 | list_add_tail(&driver->node, &acpi_pci_drivers); |
| 88 | if (driver->add) | 88 | if (driver->add) |
| 89 | list_for_each_entry(root, &acpi_pci_roots, node) { | 89 | list_for_each_entry(root, &acpi_pci_roots, node) { |
| 90 | driver->add(root->device->handle); | 90 | driver->add(root); |
| 91 | n++; | 91 | n++; |
| 92 | } | 92 | } |
| 93 | mutex_unlock(&acpi_pci_root_lock); | 93 | mutex_unlock(&acpi_pci_root_lock); |
| @@ -104,7 +104,7 @@ void acpi_pci_unregister_driver(struct acpi_pci_driver *driver) | |||
| 104 | list_del(&driver->node); | 104 | list_del(&driver->node); |
| 105 | if (driver->remove) | 105 | if (driver->remove) |
| 106 | list_for_each_entry(root, &acpi_pci_roots, node) | 106 | list_for_each_entry(root, &acpi_pci_roots, node) |
| 107 | driver->remove(root->device->handle); | 107 | driver->remove(root); |
| 108 | mutex_unlock(&acpi_pci_root_lock); | 108 | mutex_unlock(&acpi_pci_root_lock); |
| 109 | } | 109 | } |
| 110 | EXPORT_SYMBOL(acpi_pci_unregister_driver); | 110 | EXPORT_SYMBOL(acpi_pci_unregister_driver); |
| @@ -629,7 +629,7 @@ static int acpi_pci_root_start(struct acpi_device *device) | |||
| 629 | mutex_lock(&acpi_pci_root_lock); | 629 | mutex_lock(&acpi_pci_root_lock); |
| 630 | list_for_each_entry(driver, &acpi_pci_drivers, node) | 630 | list_for_each_entry(driver, &acpi_pci_drivers, node) |
| 631 | if (driver->add) | 631 | if (driver->add) |
| 632 | driver->add(device->handle); | 632 | driver->add(root); |
| 633 | mutex_unlock(&acpi_pci_root_lock); | 633 | mutex_unlock(&acpi_pci_root_lock); |
| 634 | 634 | ||
| 635 | pci_bus_add_devices(root->bus); | 635 | pci_bus_add_devices(root->bus); |
| @@ -645,7 +645,7 @@ static int acpi_pci_root_remove(struct acpi_device *device, int type) | |||
| 645 | mutex_lock(&acpi_pci_root_lock); | 645 | mutex_lock(&acpi_pci_root_lock); |
| 646 | list_for_each_entry(driver, &acpi_pci_drivers, node) | 646 | list_for_each_entry(driver, &acpi_pci_drivers, node) |
| 647 | if (driver->remove) | 647 | if (driver->remove) |
| 648 | driver->remove(root->device->handle); | 648 | driver->remove(root); |
| 649 | mutex_unlock(&acpi_pci_root_lock); | 649 | mutex_unlock(&acpi_pci_root_lock); |
| 650 | 650 | ||
| 651 | device_set_run_wake(root->bus->bridge, false); | 651 | device_set_run_wake(root->bus->bridge, false); |
diff --git a/drivers/acpi/pci_slot.c b/drivers/acpi/pci_slot.c index e50e31a518af..8051ffa7609d 100644 --- a/drivers/acpi/pci_slot.c +++ b/drivers/acpi/pci_slot.c | |||
| @@ -67,8 +67,8 @@ struct acpi_pci_slot { | |||
| 67 | struct list_head list; /* node in the list of slots */ | 67 | struct list_head list; /* node in the list of slots */ |
| 68 | }; | 68 | }; |
| 69 | 69 | ||
| 70 | static int acpi_pci_slot_add(acpi_handle handle); | 70 | static int acpi_pci_slot_add(struct acpi_pci_root *root); |
| 71 | static void acpi_pci_slot_remove(acpi_handle handle); | 71 | static void acpi_pci_slot_remove(struct acpi_pci_root *root); |
| 72 | 72 | ||
| 73 | static LIST_HEAD(slot_list); | 73 | static LIST_HEAD(slot_list); |
| 74 | static DEFINE_MUTEX(slot_list_lock); | 74 | static DEFINE_MUTEX(slot_list_lock); |
| @@ -295,11 +295,11 @@ walk_root_bridge(acpi_handle handle, acpi_walk_callback user_function) | |||
| 295 | * @handle: points to an acpi_pci_root | 295 | * @handle: points to an acpi_pci_root |
| 296 | */ | 296 | */ |
| 297 | static int | 297 | static int |
| 298 | acpi_pci_slot_add(acpi_handle handle) | 298 | acpi_pci_slot_add(struct acpi_pci_root *root) |
| 299 | { | 299 | { |
| 300 | acpi_status status; | 300 | acpi_status status; |
| 301 | 301 | ||
| 302 | status = walk_root_bridge(handle, register_slot); | 302 | status = walk_root_bridge(root->device->handle, register_slot); |
| 303 | if (ACPI_FAILURE(status)) | 303 | if (ACPI_FAILURE(status)) |
| 304 | err("%s: register_slot failure - %d\n", __func__, status); | 304 | err("%s: register_slot failure - %d\n", __func__, status); |
| 305 | 305 | ||
| @@ -311,10 +311,11 @@ acpi_pci_slot_add(acpi_handle handle) | |||
| 311 | * @handle: points to an acpi_pci_root | 311 | * @handle: points to an acpi_pci_root |
| 312 | */ | 312 | */ |
| 313 | static void | 313 | static void |
| 314 | acpi_pci_slot_remove(acpi_handle handle) | 314 | acpi_pci_slot_remove(struct acpi_pci_root *root) |
| 315 | { | 315 | { |
| 316 | struct acpi_pci_slot *slot, *tmp; | 316 | struct acpi_pci_slot *slot, *tmp; |
| 317 | struct pci_bus *pbus; | 317 | struct pci_bus *pbus; |
| 318 | acpi_handle handle = root->device->handle; | ||
| 318 | 319 | ||
| 319 | mutex_lock(&slot_list_lock); | 320 | mutex_lock(&slot_list_lock); |
| 320 | list_for_each_entry_safe(slot, tmp, &slot_list, list) { | 321 | list_for_each_entry_safe(slot, tmp, &slot_list, list) { |
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index 7be4ca5e1f4c..466233b481b1 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c | |||
| @@ -382,10 +382,10 @@ static inline void config_p2p_bridge_flags(struct acpiphp_bridge *bridge) | |||
| 382 | 382 | ||
| 383 | 383 | ||
| 384 | /* allocate and initialize host bridge data structure */ | 384 | /* allocate and initialize host bridge data structure */ |
| 385 | static void add_host_bridge(acpi_handle *handle) | 385 | static void add_host_bridge(struct acpi_pci_root *root) |
| 386 | { | 386 | { |
| 387 | struct acpiphp_bridge *bridge; | 387 | struct acpiphp_bridge *bridge; |
| 388 | struct acpi_pci_root *root = acpi_pci_find_root(handle); | 388 | acpi_handle handle = root->device->handle; |
| 389 | 389 | ||
| 390 | bridge = kzalloc(sizeof(struct acpiphp_bridge), GFP_KERNEL); | 390 | bridge = kzalloc(sizeof(struct acpiphp_bridge), GFP_KERNEL); |
| 391 | if (bridge == NULL) | 391 | if (bridge == NULL) |
| @@ -468,11 +468,12 @@ find_p2p_bridge(acpi_handle handle, u32 lvl, void *context, void **rv) | |||
| 468 | 468 | ||
| 469 | 469 | ||
| 470 | /* find hot-pluggable slots, and then find P2P bridge */ | 470 | /* find hot-pluggable slots, and then find P2P bridge */ |
| 471 | static int add_bridge(acpi_handle handle) | 471 | static int add_bridge(struct acpi_pci_root *root) |
| 472 | { | 472 | { |
| 473 | acpi_status status; | 473 | acpi_status status; |
| 474 | unsigned long long tmp; | 474 | unsigned long long tmp; |
| 475 | acpi_handle dummy_handle; | 475 | acpi_handle dummy_handle; |
| 476 | acpi_handle handle = root->device->handle; | ||
| 476 | 477 | ||
| 477 | /* if the bridge doesn't have _STA, we assume it is always there */ | 478 | /* if the bridge doesn't have _STA, we assume it is always there */ |
| 478 | status = acpi_get_handle(handle, "_STA", &dummy_handle); | 479 | status = acpi_get_handle(handle, "_STA", &dummy_handle); |
| @@ -490,7 +491,7 @@ static int add_bridge(acpi_handle handle) | |||
| 490 | /* check if this bridge has ejectable slots */ | 491 | /* check if this bridge has ejectable slots */ |
| 491 | if (detect_ejectable_slots(handle) > 0) { | 492 | if (detect_ejectable_slots(handle) > 0) { |
| 492 | dbg("found PCI host-bus bridge with hot-pluggable slots\n"); | 493 | dbg("found PCI host-bus bridge with hot-pluggable slots\n"); |
| 493 | add_host_bridge(handle); | 494 | add_host_bridge(root); |
| 494 | } | 495 | } |
| 495 | 496 | ||
| 496 | /* search P2P bridges under this host bridge */ | 497 | /* search P2P bridges under this host bridge */ |
| @@ -588,9 +589,10 @@ cleanup_p2p_bridge(acpi_handle handle, u32 lvl, void *context, void **rv) | |||
| 588 | return AE_OK; | 589 | return AE_OK; |
| 589 | } | 590 | } |
| 590 | 591 | ||
| 591 | static void remove_bridge(acpi_handle handle) | 592 | static void remove_bridge(struct acpi_pci_root *root) |
| 592 | { | 593 | { |
| 593 | struct acpiphp_bridge *bridge; | 594 | struct acpiphp_bridge *bridge; |
| 595 | acpi_handle handle = root->device->handle; | ||
| 594 | 596 | ||
| 595 | /* cleanup p2p bridges under this host bridge | 597 | /* cleanup p2p bridges under this host bridge |
| 596 | in a depth-first manner */ | 598 | in a depth-first manner */ |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index a54cf8e512ad..6906e6fb82ea 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -139,8 +139,8 @@ void acpi_pci_irq_disable (struct pci_dev *dev); | |||
| 139 | 139 | ||
| 140 | struct acpi_pci_driver { | 140 | struct acpi_pci_driver { |
| 141 | struct list_head node; | 141 | struct list_head node; |
| 142 | int (*add)(acpi_handle handle); | 142 | int (*add)(struct acpi_pci_root *root); |
| 143 | void (*remove)(acpi_handle handle); | 143 | void (*remove)(struct acpi_pci_root *root); |
| 144 | }; | 144 | }; |
| 145 | 145 | ||
| 146 | int acpi_pci_register_driver(struct acpi_pci_driver *driver); | 146 | int acpi_pci_register_driver(struct acpi_pci_driver *driver); |
