summaryrefslogtreecommitdiff
path: root/drivers/acpi/scan.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-01-14 19:47:37 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-01-25 18:59:43 +0100
commit5e73c5187cf4f40a5e02b6c8e4dd0fcf9686c006 (patch)
tree95f3d7aff011beb3e2f3f7efd54f772493214be2 /drivers/acpi/scan.c
parentc1013ff7a5472db637c56bb6237f8343398c03a7 (diff)
ACPI: scan: Adjust white space in acpi_device_add()
Add empty lines in some places in acpi_device_add() to help readability and drop leading spaces before the labels in there. 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.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 0fb1811772b5..1510afa7094d 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -694,10 +694,12 @@ int acpi_device_add(struct acpi_device *device,
if (device->wakeup.flags.valid)
list_add_tail(&device->wakeup_list, &acpi_wakeup_device_list);
+
mutex_unlock(&acpi_device_lock);
if (device->parent)
device->dev.parent = &device->parent->dev;
+
device->dev.bus = &acpi_bus_type;
device->dev.release = release;
result = device_add(&device->dev);
@@ -713,16 +715,19 @@ int acpi_device_add(struct acpi_device *device,
return 0;
- err:
+err:
mutex_lock(&acpi_device_lock);
+
if (device->parent)
list_del(&device->node);
+
list_del(&device->wakeup_list);
- err_unlock:
+err_unlock:
mutex_unlock(&acpi_device_lock);
acpi_detach_data(device->handle, acpi_scan_drop_device);
+
return result;
}