Skip to content

Commit c31b3a1

Browse files
committed
ACPI: thermal: Drop struct acpi_thermal_flags
Drop struct acpi_thermal_flags which is not really used (only one flag in it is ever set, but it is never read) and call acpi_execute_simple_method() directly to evaluate _SCP instead of using acpi_thermal_set_cooling_mode(), which has no callers after that change, so drop it. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <[email protected]> Reviewed-by: Daniel Lezcano <[email protected]>
1 parent f75fbe2 commit c31b3a1

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

drivers/acpi/thermal.c

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -129,20 +129,13 @@ struct acpi_thermal_trips {
129129
struct acpi_thermal_active active[ACPI_THERMAL_MAX_ACTIVE];
130130
};
131131

132-
struct acpi_thermal_flags {
133-
u8 cooling_mode:1; /* _SCP */
134-
u8 devices:1; /* _TZD */
135-
u8 reserved:6;
136-
};
137-
138132
struct acpi_thermal {
139133
struct acpi_device *device;
140134
acpi_bus_id name;
141135
unsigned long temperature;
142136
unsigned long last_temperature;
143137
unsigned long polling_frequency;
144138
volatile u8 zombie;
145-
struct acpi_thermal_flags flags;
146139
struct acpi_thermal_trips trips;
147140
struct acpi_handle_list devices;
148141
struct thermal_zone_device *thermal_zone;
@@ -197,18 +190,6 @@ static int acpi_thermal_get_polling_frequency(struct acpi_thermal *tz)
197190
return 0;
198191
}
199192

200-
static int acpi_thermal_set_cooling_mode(struct acpi_thermal *tz, int mode)
201-
{
202-
if (!tz)
203-
return -EINVAL;
204-
205-
if (ACPI_FAILURE(acpi_execute_simple_method(tz->device->handle,
206-
"_SCP", mode)))
207-
return -ENODEV;
208-
209-
return 0;
210-
}
211-
212193
static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
213194
{
214195
acpi_status status;
@@ -926,9 +907,8 @@ static int acpi_thermal_get_info(struct acpi_thermal *tz)
926907
return result;
927908

928909
/* Set the cooling mode [_SCP] to active cooling (default) */
929-
result = acpi_thermal_set_cooling_mode(tz, ACPI_THERMAL_MODE_ACTIVE);
930-
if (!result)
931-
tz->flags.cooling_mode = 1;
910+
acpi_execute_simple_method(tz->device->handle, "_SCP",
911+
ACPI_THERMAL_MODE_ACTIVE);
932912

933913
/* Get default polling frequency [_TZP] (optional) */
934914
if (tzp)

0 commit comments

Comments
 (0)