acpi: thermal: initialize tz_enabled to 1
authorSameer Nanda <snanda@chromium.org>
Tue, 30 Oct 2012 18:50:34 +0000 (11:50 -0700)
committerGerrit <chrome-bot@google.com>
Tue, 30 Oct 2012 21:06:49 +0000 (14:06 -0700)
In the acpi_thermal_add path, acpi_thermal_get_info gets called before
acpi_thermal_register_thermal_zone.  Since tz_enabled was getting set to
1 only in acpi_thermal_register_thermal_zone, acpi_thermal_get_info
ended up disabling thermal polling.

Moved setting of tz_enabled to 1 into acpi_thermal_add itself.

BUG=chrome-os-partner:15697
TEST=on kiev, run CPU soaker threads ("while true; do true; done") and ensure
that the fan turns on as the CPU heats up.

Change-Id: Ib2ad69621ce32f252a8b913387e1560d0750b822
Signed-off-by: Sameer Nanda <snanda@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36927
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Bernie Thompson <bhthompson@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
drivers/acpi/thermal.c

index 2cf1743..e0fd9bd 100644 (file)
@@ -898,8 +898,6 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
                return -ENODEV;
        }
 
-       tz->tz_enabled = 1;
-
        dev_info(&tz->device->dev, "registered as thermal_zone%d\n",
                 tz->thermal_zone->id);
        return 0;
@@ -1013,6 +1011,7 @@ static int acpi_thermal_add(struct acpi_device *device)
                return -ENOMEM;
 
        tz->device = device;
+       tz->tz_enabled = 1;
        strcpy(tz->name, device->pnp.bus_id);
        strcpy(acpi_device_name(device), ACPI_THERMAL_DEVICE_NAME);
        strcpy(acpi_device_class(device), ACPI_THERMAL_CLASS);