Lines 168-173
struct acpi_thermal {
Link Here
|
168 |
struct acpi_thermal_trips trips; |
168 |
struct acpi_thermal_trips trips; |
169 |
struct acpi_handle_list devices; |
169 |
struct acpi_handle_list devices; |
170 |
struct timer_list timer; |
170 |
struct timer_list timer; |
|
|
171 |
struct mutex lock; |
171 |
}; |
172 |
}; |
172 |
|
173 |
|
173 |
static const struct file_operations acpi_thermal_state_fops = { |
174 |
static const struct file_operations acpi_thermal_state_fops = { |
Lines 662-672
static void acpi_thermal_check(void *data)
Link Here
|
662 |
return; |
663 |
return; |
663 |
} |
664 |
} |
664 |
|
665 |
|
|
|
666 |
/* Check if someone already does thermal check */ |
667 |
if (!mutex_trylock(&tz->lock)) |
668 |
return; |
669 |
|
665 |
state = tz->state; |
670 |
state = tz->state; |
666 |
|
671 |
|
667 |
result = acpi_thermal_get_temperature(tz); |
672 |
result = acpi_thermal_get_temperature(tz); |
668 |
if (result) |
673 |
if (result) |
669 |
return; |
674 |
goto end; |
670 |
|
675 |
|
671 |
memset(&tz->state, 0, sizeof(tz->state)); |
676 |
memset(&tz->state, 0, sizeof(tz->state)); |
672 |
|
677 |
|
Lines 755-762
static void acpi_thermal_check(void *data)
Link Here
|
755 |
add_timer(&(tz->timer)); |
760 |
add_timer(&(tz->timer)); |
756 |
} |
761 |
} |
757 |
} |
762 |
} |
758 |
|
763 |
end: |
759 |
return; |
764 |
mutex_unlock(&tz->lock); |
760 |
} |
765 |
} |
761 |
|
766 |
|
762 |
/* -------------------------------------------------------------------------- |
767 |
/* -------------------------------------------------------------------------- |
Lines 1175-1180
static int acpi_thermal_add(struct acpi_device *device)
Link Here
|
1175 |
if (!tz) |
1180 |
if (!tz) |
1176 |
return -ENOMEM; |
1181 |
return -ENOMEM; |
1177 |
|
1182 |
|
|
|
1183 |
mutex_init(&tz->lock); |
1178 |
tz->device = device; |
1184 |
tz->device = device; |
1179 |
strcpy(tz->name, device->pnp.bus_id); |
1185 |
strcpy(tz->name, device->pnp.bus_id); |
1180 |
strcpy(acpi_device_name(device), ACPI_THERMAL_DEVICE_NAME); |
1186 |
strcpy(acpi_device_name(device), ACPI_THERMAL_DEVICE_NAME); |