Commit 1859a671 authored by Jonathan Cameron's avatar Jonathan Cameron Committed by Catalin Marinas

ACPI: scan: switch to flags for acpi_scan_check_and_detach()

Precursor patch adds the ability to pass a uintptr_t of flags into
acpi_scan_check_and detach() so that additional flags can be
added to indicate whether to defer portions of the eject flow.
The new flag follows in the next patch.
Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: default avatarHanjun Guo <guohanjun@huawei.com>
Reviewed-by: default avatarGavin Shan <gshan@redhat.com>
Tested-by: default avatarMiguel Luis <miguel.luis@oracle.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20240529133446.28446-10-Jonathan.Cameron@huawei.comSigned-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent b398a91d
...@@ -243,13 +243,16 @@ static int acpi_scan_try_to_offline(struct acpi_device *device) ...@@ -243,13 +243,16 @@ static int acpi_scan_try_to_offline(struct acpi_device *device)
return 0; return 0;
} }
static int acpi_scan_check_and_detach(struct acpi_device *adev, void *check) #define ACPI_SCAN_CHECK_FLAG_STATUS BIT(0)
static int acpi_scan_check_and_detach(struct acpi_device *adev, void *p)
{ {
struct acpi_scan_handler *handler = adev->handler; struct acpi_scan_handler *handler = adev->handler;
uintptr_t flags = (uintptr_t)p;
acpi_dev_for_each_child_reverse(adev, acpi_scan_check_and_detach, check); acpi_dev_for_each_child_reverse(adev, acpi_scan_check_and_detach, p);
if (check) { if (flags & ACPI_SCAN_CHECK_FLAG_STATUS) {
acpi_bus_get_status(adev); acpi_bus_get_status(adev);
/* /*
* Skip devices that are still there and take the enabled * Skip devices that are still there and take the enabled
...@@ -287,7 +290,9 @@ static int acpi_scan_check_and_detach(struct acpi_device *adev, void *check) ...@@ -287,7 +290,9 @@ static int acpi_scan_check_and_detach(struct acpi_device *adev, void *check)
static void acpi_scan_check_subtree(struct acpi_device *adev) static void acpi_scan_check_subtree(struct acpi_device *adev)
{ {
acpi_scan_check_and_detach(adev, (void *)true); uintptr_t flags = ACPI_SCAN_CHECK_FLAG_STATUS;
acpi_scan_check_and_detach(adev, (void *)flags);
} }
static int acpi_scan_hot_remove(struct acpi_device *device) static int acpi_scan_hot_remove(struct acpi_device *device)
...@@ -2596,7 +2601,9 @@ EXPORT_SYMBOL(acpi_bus_scan); ...@@ -2596,7 +2601,9 @@ EXPORT_SYMBOL(acpi_bus_scan);
*/ */
void acpi_bus_trim(struct acpi_device *adev) void acpi_bus_trim(struct acpi_device *adev)
{ {
acpi_scan_check_and_detach(adev, NULL); uintptr_t flags = 0;
acpi_scan_check_and_detach(adev, (void *)flags);
} }
EXPORT_SYMBOL_GPL(acpi_bus_trim); EXPORT_SYMBOL_GPL(acpi_bus_trim);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment