Skip to content

Commit 2a74c4a

Browse files
committed
ACPI: thermal: Drop unnecessary thermal zone callbacks
Drop the .get_trip_type(), .get_trip_temp() and .get_crit_temp() thermal zone callbacks that are not necessary any more from the ACPI thermal driver along with the corresponding callback functions. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 9caaad2 commit 2a74c4a

File tree

1 file changed

+0
-115
lines changed

1 file changed

+0
-115
lines changed

drivers/acpi/thermal.c

Lines changed: 0 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -485,118 +485,6 @@ static int thermal_get_temp(struct thermal_zone_device *thermal, int *temp)
485485
return 0;
486486
}
487487

488-
static int thermal_get_trip_type(struct thermal_zone_device *thermal,
489-
int trip, enum thermal_trip_type *type)
490-
{
491-
struct acpi_thermal *tz = thermal_zone_device_priv(thermal);
492-
int i;
493-
494-
if (!tz || trip < 0)
495-
return -EINVAL;
496-
497-
if (tz->trips.critical.valid) {
498-
if (!trip) {
499-
*type = THERMAL_TRIP_CRITICAL;
500-
return 0;
501-
}
502-
trip--;
503-
}
504-
505-
if (tz->trips.hot.valid) {
506-
if (!trip) {
507-
*type = THERMAL_TRIP_HOT;
508-
return 0;
509-
}
510-
trip--;
511-
}
512-
513-
if (tz->trips.passive.trip.valid) {
514-
if (!trip) {
515-
*type = THERMAL_TRIP_PASSIVE;
516-
return 0;
517-
}
518-
trip--;
519-
}
520-
521-
for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE && tz->trips.active[i].trip.valid; i++) {
522-
if (!trip) {
523-
*type = THERMAL_TRIP_ACTIVE;
524-
return 0;
525-
}
526-
trip--;
527-
}
528-
529-
return -EINVAL;
530-
}
531-
532-
static int thermal_get_trip_temp(struct thermal_zone_device *thermal,
533-
int trip, int *temp)
534-
{
535-
struct acpi_thermal *tz = thermal_zone_device_priv(thermal);
536-
int i;
537-
538-
if (!tz || trip < 0)
539-
return -EINVAL;
540-
541-
if (tz->trips.critical.valid) {
542-
if (!trip) {
543-
*temp = deci_kelvin_to_millicelsius_with_offset(
544-
tz->trips.critical.temperature,
545-
tz->kelvin_offset);
546-
return 0;
547-
}
548-
trip--;
549-
}
550-
551-
if (tz->trips.hot.valid) {
552-
if (!trip) {
553-
*temp = deci_kelvin_to_millicelsius_with_offset(
554-
tz->trips.hot.temperature,
555-
tz->kelvin_offset);
556-
return 0;
557-
}
558-
trip--;
559-
}
560-
561-
if (tz->trips.passive.trip.valid) {
562-
if (!trip) {
563-
*temp = deci_kelvin_to_millicelsius_with_offset(
564-
tz->trips.passive.trip.temperature,
565-
tz->kelvin_offset);
566-
return 0;
567-
}
568-
trip--;
569-
}
570-
571-
for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE &&
572-
tz->trips.active[i].trip.valid; i++) {
573-
if (!trip) {
574-
*temp = deci_kelvin_to_millicelsius_with_offset(
575-
tz->trips.active[i].trip.temperature,
576-
tz->kelvin_offset);
577-
return 0;
578-
}
579-
trip--;
580-
}
581-
582-
return -EINVAL;
583-
}
584-
585-
static int thermal_get_crit_temp(struct thermal_zone_device *thermal,
586-
int *temperature)
587-
{
588-
struct acpi_thermal *tz = thermal_zone_device_priv(thermal);
589-
590-
if (tz->trips.critical.valid) {
591-
*temperature = deci_kelvin_to_millicelsius_with_offset(
592-
tz->trips.critical.temperature,
593-
tz->kelvin_offset);
594-
return 0;
595-
}
596-
597-
return -EINVAL;
598-
}
599-
600488
static int thermal_get_trend(struct thermal_zone_device *thermal,
601489
int trip_index, enum thermal_trend *trend)
602490
{
@@ -759,9 +647,6 @@ static struct thermal_zone_device_ops acpi_thermal_zone_ops = {
759647
.bind = acpi_thermal_bind_cooling_device,
760648
.unbind = acpi_thermal_unbind_cooling_device,
761649
.get_temp = thermal_get_temp,
762-
.get_trip_type = thermal_get_trip_type,
763-
.get_trip_temp = thermal_get_trip_temp,
764-
.get_crit_temp = thermal_get_crit_temp,
765650
.get_trend = thermal_get_trend,
766651
.hot = acpi_thermal_zone_device_hot,
767652
.critical = acpi_thermal_zone_device_critical,

0 commit comments

Comments
 (0)