@@ -883,6 +880,10 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
int result;
acpi_status status;
int i;
+ int tc1;
+ int tc2;
+ int passive_delay;
+ int polling_delay;
if (tz->trips.critical.flags.valid)
trips++;
@@ -894,22 +895,25 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
trips++;
for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE &&
- tz->trips.active[i].flags.valid; i++, trips++);
+ tz->trips.active[i].flags.valid; i++)
+ trips++;
- if (tz->trips.passive.flags.valid)
- tz->thermal_zone =
- thermal_zone_device_register("acpitz", trips, tz,
- &acpi_thermal_zone_ops,
- tz->trips.passive.tc1,
- tz->trips.passive.tc2,
- tz->trips.passive.tsp*100,
- tz->polling_frequency*100);
- else
- tz->thermal_zone =
- thermal_zone_device_register("acpitz", trips, tz,
- &acpi_thermal_zone_ops,
- 0, 0, 0,
- tz->polling_frequency);
+ if (tz->trips.passive.flags.valid) {
+ tc1 = tz->trips.passive.tc1;
+ tc2 = tz->trips.passive.tc2;
+ passive_delay = tz->trips.passive.tsp * 100;
+ } else {
+ tc1 = 0;
+ tc2 = 0;
+ passive_delay = 0;
+ }
+ polling_delay = tz->polling_frequency * 100;
+
+ tz->thermal_zone =
+ thermal_zone_device_register("acpitz", trips, tz,
+ &acpi_thermal_zone_ops,
+ tc1, tc2, passive_delay,
+ polling_delay);
if (IS_ERR(tz->thermal_zone))
return -ENODEV;