diff options
Diffstat (limited to 'drivers/acpi/thermal.c')
-rw-r--r-- | drivers/acpi/thermal.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 15022bc86336..0ae8b9310cbf 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c | |||
@@ -1356,28 +1356,32 @@ static int acpi_thermal_remove(struct acpi_device *device, int type) | |||
1356 | static int acpi_thermal_resume(struct acpi_device *device) | 1356 | static int acpi_thermal_resume(struct acpi_device *device) |
1357 | { | 1357 | { |
1358 | struct acpi_thermal *tz = NULL; | 1358 | struct acpi_thermal *tz = NULL; |
1359 | int i; | 1359 | int i, j, power_state, result; |
1360 | |||
1360 | 1361 | ||
1361 | if (!device || !acpi_driver_data(device)) | 1362 | if (!device || !acpi_driver_data(device)) |
1362 | return -EINVAL; | 1363 | return -EINVAL; |
1363 | 1364 | ||
1364 | tz = acpi_driver_data(device); | 1365 | tz = acpi_driver_data(device); |
1365 | 1366 | ||
1366 | acpi_thermal_get_temperature(tz); | ||
1367 | |||
1368 | for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) { | 1367 | for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) { |
1369 | if (tz->trips.active[i].flags.valid) { | 1368 | if (!(&tz->trips.active[i])) |
1370 | tz->temperature = tz->trips.active[i].temperature; | 1369 | break; |
1371 | tz->trips.active[i].flags.enabled = 0; | 1370 | if (!tz->trips.active[i].flags.valid) |
1372 | 1371 | break; | |
1373 | acpi_thermal_active(tz); | 1372 | tz->trips.active[i].flags.enabled = 1; |
1374 | 1373 | for (j = 0; j < tz->trips.active[i].devices.count; j++) { | |
1375 | tz->state.active |= tz->trips.active[i].flags.enabled; | 1374 | result = acpi_bus_get_power(tz->trips.active[i].devices. |
1376 | tz->state.active_index = i; | 1375 | handles[j], &power_state); |
1376 | if (result || (power_state != ACPI_STATE_D0)) { | ||
1377 | tz->trips.active[i].flags.enabled = 0; | ||
1378 | break; | ||
1379 | } | ||
1377 | } | 1380 | } |
1381 | tz->state.active |= tz->trips.active[i].flags.enabled; | ||
1378 | } | 1382 | } |
1379 | 1383 | ||
1380 | acpi_thermal_check(tz); | 1384 | acpi_thermal_check(tz); |
1381 | 1385 | ||
1382 | return AE_OK; | 1386 | return AE_OK; |
1383 | } | 1387 | } |