diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-18 11:13:39 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-18 11:13:39 -0500 |
| commit | 2fa298cf6d6bedf64f75644e9e8b0d64d2d83f27 (patch) | |
| tree | bd04abc0761ee1bfdf4baa0471d4fc5e6c3aa121 /drivers/acpi/scan.c | |
| parent | 86404ab60df2ea65f39be936fc11762b642810c3 (diff) | |
| parent | 0e2ecbaefd219cb538aa7827f37da064d1a3328b (diff) | |
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
ACPI: fix "acpi=ht" boot option
ACPI, i915: blacklist Clevo M5x0N bad_lid state
ACPI: fix High cpu temperature with 2.6.32
ACPI: dock: properly initialize local struct dock_station in dock_add()
ACPI: remove Asus P2B-DS from acpi=ht blacklist
thinkpad-acpi: wrong thermal attribute_group removed in thermal_exit()
ACPI: acpi_bus_{scan,bus,add}: return -ENODEV if no device was found
ACPI: Add NULL pointer check in acpi_bus_start
ACPI: processor: only evaluate _PDC once per processor
ACPI: processor: add kernel command line support for early _PDC eval
Diffstat (limited to 'drivers/acpi/scan.c')
| -rw-r--r-- | drivers/acpi/scan.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index ff9f6226085d..3e009674f333 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
| @@ -1336,9 +1336,25 @@ static int acpi_bus_scan(acpi_handle handle, struct acpi_bus_ops *ops, | |||
| 1336 | 1336 | ||
| 1337 | if (child) | 1337 | if (child) |
| 1338 | *child = device; | 1338 | *child = device; |
| 1339 | return 0; | 1339 | |
| 1340 | if (device) | ||
| 1341 | return 0; | ||
| 1342 | else | ||
| 1343 | return -ENODEV; | ||
| 1340 | } | 1344 | } |
| 1341 | 1345 | ||
| 1346 | /* | ||
| 1347 | * acpi_bus_add and acpi_bus_start | ||
| 1348 | * | ||
| 1349 | * scan a given ACPI tree and (probably recently hot-plugged) | ||
| 1350 | * create and add or starts found devices. | ||
| 1351 | * | ||
| 1352 | * If no devices were found -ENODEV is returned which does not | ||
| 1353 | * mean that this is a real error, there just have been no suitable | ||
| 1354 | * ACPI objects in the table trunk from which the kernel could create | ||
| 1355 | * a device and add/start an appropriate driver. | ||
| 1356 | */ | ||
| 1357 | |||
| 1342 | int | 1358 | int |
| 1343 | acpi_bus_add(struct acpi_device **child, | 1359 | acpi_bus_add(struct acpi_device **child, |
| 1344 | struct acpi_device *parent, acpi_handle handle, int type) | 1360 | struct acpi_device *parent, acpi_handle handle, int type) |
| @@ -1348,8 +1364,7 @@ acpi_bus_add(struct acpi_device **child, | |||
| 1348 | memset(&ops, 0, sizeof(ops)); | 1364 | memset(&ops, 0, sizeof(ops)); |
| 1349 | ops.acpi_op_add = 1; | 1365 | ops.acpi_op_add = 1; |
| 1350 | 1366 | ||
| 1351 | acpi_bus_scan(handle, &ops, child); | 1367 | return acpi_bus_scan(handle, &ops, child); |
| 1352 | return 0; | ||
| 1353 | } | 1368 | } |
| 1354 | EXPORT_SYMBOL(acpi_bus_add); | 1369 | EXPORT_SYMBOL(acpi_bus_add); |
| 1355 | 1370 | ||
| @@ -1357,11 +1372,13 @@ int acpi_bus_start(struct acpi_device *device) | |||
| 1357 | { | 1372 | { |
| 1358 | struct acpi_bus_ops ops; | 1373 | struct acpi_bus_ops ops; |
| 1359 | 1374 | ||
| 1375 | if (!device) | ||
| 1376 | return -EINVAL; | ||
| 1377 | |||
| 1360 | memset(&ops, 0, sizeof(ops)); | 1378 | memset(&ops, 0, sizeof(ops)); |
| 1361 | ops.acpi_op_start = 1; | 1379 | ops.acpi_op_start = 1; |
| 1362 | 1380 | ||
| 1363 | acpi_bus_scan(device->handle, &ops, NULL); | 1381 | return acpi_bus_scan(device->handle, &ops, NULL); |
| 1364 | return 0; | ||
| 1365 | } | 1382 | } |
| 1366 | EXPORT_SYMBOL(acpi_bus_start); | 1383 | EXPORT_SYMBOL(acpi_bus_start); |
| 1367 | 1384 | ||
