Skip to content
  • Andy Shevchenko's avatar
    ACPI: platform: Unregister stale platform devices · cb0701ac
    Andy Shevchenko authored
    When commit 68bdb677 ("ACPI: add support for ACPI reconfiguration
    notifiers") introduced reconfiguration notifiers, it missed the point
    that the ACPI table, which might be loaded and then unloaded via
    ConfigFS, could contain devices that were not enumerated by their
    parents.
    
    In such cases, the stale platform device is dangling in the system
    while the rest of the devices from the same table are already gone.
    
    Introduce acpi_platform_device_remove_notify() notifier that, in
    similar way to I²C or SPI buses, unregisters the platform devices
    on table removal event.
    
    Fixes: 68bdb677 ("ACPI: add support for ACPI reconfiguration notifiers")
    Depends-on: 00500147
    
     ("drivers: Introduce device lookup variants by ACPI_COMPANION device")
    Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
    [ rjw: Changelog & function rename ]
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    cb0701ac