ACPI: Add .setup() and .cleanup() callbacks to struct acpi_bus_type
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 22 Dec 2012 23:02:13 +0000 (00:02 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 3 Jan 2013 12:09:40 +0000 (13:09 +0100)
commit11909ca1cf614f9396b17d366f9e3cfcba7b4a99
tree64ac9e3885d22043acd7a29169104126d602ce31
parent0cd6ac52b333f66ee64e50ed216ec99231092dcd
ACPI: Add .setup() and .cleanup() callbacks to struct acpi_bus_type

Add two new callbacks,.setup() and .cleanup(), struct acpi_bus_type
and modify acpi_platform_notify() to call .setup() after executing
acpi_bind_one() successfully and acpi_platform_notify_remove() to
call .cleanup() before running acpi_unbind_one().  This will allow
the users of struct acpi_bus_type, PCI in particular, to specify
operations to be executed right after the given device has been
associated with a companion struct acpi_device and right before
it's going to be detached from that companion, respectively.

The main motivation is to be able to get rid of acpi_pci_bind()
and acpi_pci_unbind(), which are horrible horrible stuff.  [In short,
there are three problems with them: The way they populate the .bind()
and .unbind() callbacks of ACPI devices is rather less than
straightforward, they require special hotplug-specific paths to be
present in the ACPI namespace scanning code and by the time
acpi_pci_unbind() is called the PCI device object in question may
not exist any more.]

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Yinghai Lu <yinghai@kernel.org>
Acked-by: Toshi Kani <toshi.kani@hp.com>
drivers/acpi/glue.c
include/acpi/acpi_bus.h
This page took 0.024851 seconds and 5 git commands to generate.