Skip to content

Commit

Permalink
ACPI: scan: Rearrange acpi_dev_get_first_consumer_dev_cb()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
rafaeljw committed Jun 17, 2021
1 parent 2d07951 commit ad4d451
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -2101,13 +2101,12 @@ static int acpi_dev_get_first_consumer_dev_cb(struct acpi_dep_data *dep, void *d
struct acpi_device *adev;

adev = acpi_bus_get_acpi_device(dep->consumer);
if (!adev)
/* If we don't find an adev then we want to continue parsing */
return 0;

*(struct acpi_device **)data = adev;

return 1;
if (adev) {
*(struct acpi_device **)data = adev;
return 1;
}
/* Continue parsing if the device object is not present. */
return 0;
}

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

0 comments on commit ad4d451

Please sign in to comment.