Skip to content

Commit ad4d451

Browse files
committed
ACPI: scan: Rearrange acpi_dev_get_first_consumer_dev_cb()
Make acpi_dev_get_first_consumer_dev_cb() a bit more straightforward and rewrite the comment in it. No functional impact. Signed-off-by: Rafael J. Wysocki <[email protected]> Reviewed-by: Hans de Goede <[email protected]>
1 parent 2d07951 commit ad4d451

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

drivers/acpi/scan.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2101,13 +2101,12 @@ static int acpi_dev_get_first_consumer_dev_cb(struct acpi_dep_data *dep, void *d
21012101
struct acpi_device *adev;
21022102

21032103
adev = acpi_bus_get_acpi_device(dep->consumer);
2104-
if (!adev)
2105-
/* If we don't find an adev then we want to continue parsing */
2106-
return 0;
2107-
2108-
*(struct acpi_device **)data = adev;
2109-
2110-
return 1;
2104+
if (adev) {
2105+
*(struct acpi_device **)data = adev;
2106+
return 1;
2107+
}
2108+
/* Continue parsing if the device object is not present. */
2109+
return 0;
21112110
}
21122111

21132112
static int acpi_scan_clear_dep(struct acpi_dep_data *dep, void *data)

0 commit comments

Comments
 (0)