Skip to content

Commit 1859a67

Browse files
jic23ctmarinas
authored andcommitted
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: Rafael J. Wysocki <[email protected]> Reviewed-by: Hanjun Guo <[email protected]> Reviewed-by: Gavin Shan <[email protected]> Tested-by: Miguel Luis <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent b398a91 commit 1859a67

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

drivers/acpi/scan.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,16 @@ static int acpi_scan_try_to_offline(struct acpi_device *device)
243243
return 0;
244244
}
245245

246-
static int acpi_scan_check_and_detach(struct acpi_device *adev, void *check)
246+
#define ACPI_SCAN_CHECK_FLAG_STATUS BIT(0)
247+
248+
static int acpi_scan_check_and_detach(struct acpi_device *adev, void *p)
247249
{
248250
struct acpi_scan_handler *handler = adev->handler;
251+
uintptr_t flags = (uintptr_t)p;
249252

250-
acpi_dev_for_each_child_reverse(adev, acpi_scan_check_and_detach, check);
253+
acpi_dev_for_each_child_reverse(adev, acpi_scan_check_and_detach, p);
251254

252-
if (check) {
255+
if (flags & ACPI_SCAN_CHECK_FLAG_STATUS) {
253256
acpi_bus_get_status(adev);
254257
/*
255258
* 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)
287290

288291
static void acpi_scan_check_subtree(struct acpi_device *adev)
289292
{
290-
acpi_scan_check_and_detach(adev, (void *)true);
293+
uintptr_t flags = ACPI_SCAN_CHECK_FLAG_STATUS;
294+
295+
acpi_scan_check_and_detach(adev, (void *)flags);
291296
}
292297

293298
static int acpi_scan_hot_remove(struct acpi_device *device)
@@ -2596,7 +2601,9 @@ EXPORT_SYMBOL(acpi_bus_scan);
25962601
*/
25972602
void acpi_bus_trim(struct acpi_device *adev)
25982603
{
2599-
acpi_scan_check_and_detach(adev, NULL);
2604+
uintptr_t flags = 0;
2605+
2606+
acpi_scan_check_and_detach(adev, (void *)flags);
26002607
}
26012608
EXPORT_SYMBOL_GPL(acpi_bus_trim);
26022609

0 commit comments

Comments
 (0)