Skip to content

Commit

Permalink
ACPI: thermal: Drop struct acpi_thermal_flags
Browse files Browse the repository at this point in the history
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 <rafael.j.wysocki@intel.com>
Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
  • Loading branch information
Rafael J. Wysocki committed Jun 16, 2023
1 parent f75fbe2 commit c31b3a1
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions drivers/acpi/thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,20 +129,13 @@ struct acpi_thermal_trips {
struct acpi_thermal_active active[ACPI_THERMAL_MAX_ACTIVE];
};

struct acpi_thermal_flags {
u8 cooling_mode:1; /* _SCP */
u8 devices:1; /* _TZD */
u8 reserved:6;
};

struct acpi_thermal {
struct acpi_device *device;
acpi_bus_id name;
unsigned long temperature;
unsigned long last_temperature;
unsigned long polling_frequency;
volatile u8 zombie;
struct acpi_thermal_flags flags;
struct acpi_thermal_trips trips;
struct acpi_handle_list devices;
struct thermal_zone_device *thermal_zone;
Expand Down Expand Up @@ -197,18 +190,6 @@ static int acpi_thermal_get_polling_frequency(struct acpi_thermal *tz)
return 0;
}

static int acpi_thermal_set_cooling_mode(struct acpi_thermal *tz, int mode)
{
if (!tz)
return -EINVAL;

if (ACPI_FAILURE(acpi_execute_simple_method(tz->device->handle,
"_SCP", mode)))
return -ENODEV;

return 0;
}

static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
{
acpi_status status;
Expand Down Expand Up @@ -926,9 +907,8 @@ static int acpi_thermal_get_info(struct acpi_thermal *tz)
return result;

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

/* Get default polling frequency [_TZP] (optional) */
if (tzp)
Expand Down

0 comments on commit c31b3a1

Please sign in to comment.