]> git.baikalelectronics.ru Git - kernel.git/commit
ACPI: platform: Unregister stale platform devices
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 30 Aug 2019 14:34:32 +0000 (17:34 +0300)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 17 Oct 2019 21:48:39 +0000 (23:48 +0200)
commit2ad0ab817f5e90e7cb6a4b8a5a25c60079b58858
tree9a6980523a6baa259e879b3efa2081b8e85d17fb
parentde21752ce9df3c24c525f8929b355fd72042c6e3
ACPI: platform: Unregister stale platform devices

When commit c53322135013 ("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: c53322135013 ("ACPI: add support for ACPI reconfiguration notifiers")
Depends-on: 996087cf4c25 ("drivers: Introduce device lookup variants by ACPI_COMPANION device")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
[ rjw: Changelog & function rename ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpi_platform.c
drivers/acpi/scan.c