diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-07-13 23:27:23 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-07-23 03:58:42 +0200 |
commit | be1c9de98d8904c75a5ab8b2a0d97bea0f7c07cc (patch) | |
tree | 43c1f3632a3b8be20cae5db77bdcd2f0852acdd7 /drivers/acpi/pci_slot.c | |
parent | b9eb179fe6d9acc11a54194d2df147e991f049aa (diff) | |
download | blackbird-op-linux-be1c9de98d8904c75a5ab8b2a0d97bea0f7c07cc.tar.gz blackbird-op-linux-be1c9de98d8904c75a5ab8b2a0d97bea0f7c07cc.zip |
ACPI / PCI: Make bus registration and unregistration symmetric
Since acpi_pci_slot_enumerate() and acpiphp_enumerate_slots() can get
the ACPI device handle they need from bus->bridge, it is not
necessary to pass that handle to them as an argument.
Drop the second argument of acpi_pci_slot_enumerate() and
acpiphp_enumerate_slots(), rework them to obtain the ACPI handle
from bus->bridge and make acpi_pci_add_bus() and
acpi_pci_remove_bus() entirely symmetrical.
Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Yinghai Lu <yinghai@kernel.org>
Diffstat (limited to 'drivers/acpi/pci_slot.c')
-rw-r--r-- | drivers/acpi/pci_slot.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/acpi/pci_slot.c b/drivers/acpi/pci_slot.c index 033d1179bdb5..d678a180ca2a 100644 --- a/drivers/acpi/pci_slot.c +++ b/drivers/acpi/pci_slot.c @@ -159,12 +159,16 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv) return AE_OK; } -void acpi_pci_slot_enumerate(struct pci_bus *bus, acpi_handle handle) +void acpi_pci_slot_enumerate(struct pci_bus *bus) { - mutex_lock(&slot_list_lock); - acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, 1, - register_slot, NULL, bus, NULL); - mutex_unlock(&slot_list_lock); + acpi_handle handle = ACPI_HANDLE(bus->bridge); + + if (handle) { + mutex_lock(&slot_list_lock); + acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, 1, + register_slot, NULL, bus, NULL); + mutex_unlock(&slot_list_lock); + } } void acpi_pci_slot_remove(struct pci_bus *bus) |