• Rafael J. Wysocki's avatar
    PCI: ACPI: Drop acpi_pci_bus · 47954481
    Rafael J. Wysocki authored
    The acpi_pci_bus structure was used primarily for running
    acpi_pci_find_companion() during PCI device objects registration,
    but after commit 375553a9 ("PCI: Setup ACPI fwnode early and at
    the same time with OF") that function is called by pci_setup_device()
    via pci_set_acpi_fwnode(), which happens before calling
    pci_device_add() on the new PCI device object, so its ACPI companion
    has been set already when acpi_device_notify() runs and it will never
    call ->find_companion() from acpi_pci_bus.
    
    For this reason, modify acpi_device_notify() and
    acpi_device_notify_remove() to call pci_acpi_setup() and
    pci_acpi_cleanup(), respectively, directly on PCI device objects
    and drop acpi_pci_bus altogether.
    
    While at it, notice that pci_acpi_setup() and pci_acpi_cleanup()
    can obtain the ACPI companion pointer, which is guaranteed to not
    be NULL, from their callers and modify them to work that way so
    as to reduce the number of redundant checks somewhat.
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    Tested-by: default avatarFerry Toth <fntoth@gmail.com>
    47954481
glue.c 8.32 KB