]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ACPI / hotplug / PCI: Store acpi_device pointer in acpiphp_context
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 3 Feb 2014 23:39:33 +0000 (00:39 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 5 Feb 2014 16:40:39 +0000 (17:40 +0100)
commitbbcbfc0eed6220591ccc5752edd079099bb1920c
tree1fdcf26676d7ebcc1af5d34712c4e83a6edee95c
parentb2118d6a4073e394312072b6666cb576e18653b2
ACPI / hotplug / PCI: Store acpi_device pointer in acpiphp_context

After recent modifications of the ACPI core making it create a struct
acpi_device object for every namespace node representing a device
regardless of the current status of that device the ACPIPHP code
can store a struct acpi_device pointer instead of an ACPI handle
in struct acpiphp_context.  This immediately makes it possible to
avoid making potentially costly calls to acpi_bus_get_device() in
two places and allows some more simplifications to be made going
forward.

The reason why that is correct is because ACPIPHP only installs
hotify handlers for namespace nodes that exist when
acpiphp_enumerate_slots() is called for their parent bridge.
That only happens if the parent bridge has an ACPI companion
associated with it, which means that the ACPI namespace scope
in question has been scanned already at that point.  That, in
turn, means that struct acpi_device objects have been created
for all namespace nodes in that scope and pointers to those
objects can be stored directly instead of their ACPI handles.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/pci/hotplug/acpiphp.h
drivers/pci/hotplug/acpiphp_glue.c