===================================================================
@@ -741,34 +741,30 @@ static void acpi_thermal_zone_sysfs_remo
static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
{
- int trips = 0;
+ int passive_delay = 0;
+ int trip_count = 0;
int result;
acpi_status status;
int i;
if (tz->trips.critical.valid)
- trips++;
+ trip_count++;
if (tz->trips.hot.valid)
- trips++;
-
- if (tz->trips.passive.valid)
- trips++;
-
- for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE && tz->trips.active[i].valid;
- i++, trips++);
-
- if (tz->trips.passive.valid)
- tz->thermal_zone = thermal_zone_device_register("acpitz", trips, 0, tz,
- &acpi_thermal_zone_ops, NULL,
- tz->trips.passive.tsp * 100,
- tz->polling_frequency * 100);
- else
- tz->thermal_zone =
- thermal_zone_device_register("acpitz", trips, 0, tz,
- &acpi_thermal_zone_ops, NULL,
- 0, tz->polling_frequency * 100);
+ trip_count++;
+ if (tz->trips.passive.valid) {
+ trip_count++;
+ passive_delay = tz->trips.passive.tsp * 100;
+ }
+
+ for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE && tz->trips.active[i].valid; i++)
+ trip_count++;
+
+ tz->thermal_zone = thermal_zone_device_register("acpitz", trip_count, 0,
+ tz, &acpi_thermal_zone_ops,
+ NULL, passive_delay,
+ tz->polling_frequency * 100);
if (IS_ERR(tz->thermal_zone))
return -ENODEV;