diff options
Diffstat (limited to 'drivers/acpi/scan.c')
-rw-r--r-- | drivers/acpi/scan.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 954bd01f295a..2c4cac576a7e 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -1400,10 +1400,10 @@ static acpi_status acpi_bus_check_add(acpi_handle handle, u32 lvl, | |||
1400 | void *context, void **return_value) | 1400 | void *context, void **return_value) |
1401 | { | 1401 | { |
1402 | struct acpi_bus_ops *ops = context; | 1402 | struct acpi_bus_ops *ops = context; |
1403 | struct acpi_device *device = NULL; | ||
1404 | acpi_status status; | ||
1405 | int type; | 1403 | int type; |
1406 | unsigned long long sta; | 1404 | unsigned long long sta; |
1405 | struct acpi_device *device; | ||
1406 | acpi_status status; | ||
1407 | int result; | 1407 | int result; |
1408 | 1408 | ||
1409 | result = acpi_bus_type_and_status(handle, &type, &sta); | 1409 | result = acpi_bus_type_and_status(handle, &type, &sta); |
@@ -1414,13 +1414,16 @@ static acpi_status acpi_bus_check_add(acpi_handle handle, u32 lvl, | |||
1414 | !(sta & ACPI_STA_DEVICE_FUNCTIONING)) | 1414 | !(sta & ACPI_STA_DEVICE_FUNCTIONING)) |
1415 | return AE_CTRL_DEPTH; | 1415 | return AE_CTRL_DEPTH; |
1416 | 1416 | ||
1417 | if (ops->acpi_op_add) | 1417 | /* |
1418 | status = acpi_add_single_object(&device, handle, type, sta, | 1418 | * We may already have an acpi_device from a previous enumeration. If |
1419 | ops); | 1419 | * so, we needn't add it again, but we may still have to start it. |
1420 | else | 1420 | */ |
1421 | status = acpi_bus_get_device(handle, &device); | 1421 | device = NULL; |
1422 | acpi_bus_get_device(handle, &device); | ||
1423 | if (ops->acpi_op_add && !device) | ||
1424 | acpi_add_single_object(&device, handle, type, sta, ops); | ||
1422 | 1425 | ||
1423 | if (ACPI_FAILURE(status)) | 1426 | if (!device) |
1424 | return AE_CTRL_DEPTH; | 1427 | return AE_CTRL_DEPTH; |
1425 | 1428 | ||
1426 | if (ops->acpi_op_start && !(ops->acpi_op_add)) { | 1429 | if (ops->acpi_op_start && !(ops->acpi_op_add)) { |