summaryrefslogtreecommitdiff
path: root/drivers/acpi/scan.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-06-16 16:21:51 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-06-17 15:56:03 +0200
commitad4d451e14e58792e9b7c8a4bfc3276f0128e94a (patch)
tree6a5c45efdf70191a0b4017f3b0064371d7ea62f3 /drivers/acpi/scan.c
parent2d0795148a5a7dd33999daf600eb6fdeffabd6ba (diff)
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 <rafael.j.wysocki@intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/acpi/scan.c')
-rw-r--r--drivers/acpi/scan.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 75b6bbc717b0..524d85dc540c 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -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)