• R
    ACPI: Add .setup() and .cleanup() callbacks to struct acpi_bus_type · 11909ca1
    Rafael J. Wysocki 提交于
    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: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
    Acked-by: NYinghai Lu <yinghai@kernel.org>
    Acked-by: NToshi Kani <toshi.kani@hp.com>
    11909ca1
acpi_bus.h 14.4 KB