diff options
Diffstat (limited to 'drivers/acpi/scan.c')
-rw-r--r-- | drivers/acpi/scan.c | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index ad0679843bd5..89c112ef9e14 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -276,6 +276,13 @@ int acpi_match_device_ids(struct acpi_device *device, | |||
276 | { | 276 | { |
277 | const struct acpi_device_id *id; | 277 | const struct acpi_device_id *id; |
278 | 278 | ||
279 | /* | ||
280 | * If the device is not present, it is unnecessary to load device | ||
281 | * driver for it. | ||
282 | */ | ||
283 | if (!device->status.present) | ||
284 | return -ENODEV; | ||
285 | |||
279 | if (device->flags.hardware_id) { | 286 | if (device->flags.hardware_id) { |
280 | for (id = ids; id->id[0]; id++) { | 287 | for (id = ids; id->id[0]; id++) { |
281 | if (!strcmp((char*)id->id, device->pnp.hardware_id)) | 288 | if (!strcmp((char*)id->id, device->pnp.hardware_id)) |
@@ -1222,15 +1229,18 @@ acpi_add_single_object(struct acpi_device **child, | |||
1222 | result = -ENODEV; | 1229 | result = -ENODEV; |
1223 | goto end; | 1230 | goto end; |
1224 | } | 1231 | } |
1225 | if (!device->status.present) { | 1232 | /* |
1226 | /* Bay and dock should be handled even if absent */ | 1233 | * When the device is neither present nor functional, the |
1227 | if (!ACPI_SUCCESS( | 1234 | * device should not be added to Linux ACPI device tree. |
1228 | acpi_is_child_device(device, acpi_bay_match)) && | 1235 | * When the status of the device is not present but functinal, |
1229 | !ACPI_SUCCESS( | 1236 | * it should be added to Linux ACPI tree. For example : bay |
1230 | acpi_is_child_device(device, acpi_dock_match))) { | 1237 | * device , dock device. |
1231 | result = -ENODEV; | 1238 | * In such conditions it is unncessary to check whether it is |
1232 | goto end; | 1239 | * bay device or dock device. |
1233 | } | 1240 | */ |
1241 | if (!device->status.present && !device->status.functional) { | ||
1242 | result = -ENODEV; | ||
1243 | goto end; | ||
1234 | } | 1244 | } |
1235 | break; | 1245 | break; |
1236 | default: | 1246 | default: |
@@ -1411,7 +1421,12 @@ static int acpi_bus_scan(struct acpi_device *start, struct acpi_bus_ops *ops) | |||
1411 | * TBD: Need notifications and other detection mechanisms | 1421 | * TBD: Need notifications and other detection mechanisms |
1412 | * in place before we can fully implement this. | 1422 | * in place before we can fully implement this. |
1413 | */ | 1423 | */ |
1414 | if (child->status.present) { | 1424 | /* |
1425 | * When the device is not present but functional, it is also | ||
1426 | * necessary to scan the children of this device. | ||
1427 | */ | ||
1428 | if (child->status.present || (!child->status.present && | ||
1429 | child->status.functional)) { | ||
1415 | status = acpi_get_next_object(ACPI_TYPE_ANY, chandle, | 1430 | status = acpi_get_next_object(ACPI_TYPE_ANY, chandle, |
1416 | NULL, NULL); | 1431 | NULL, NULL); |
1417 | if (ACPI_SUCCESS(status)) { | 1432 | if (ACPI_SUCCESS(status)) { |