Skip to content

Commit 35d8dbb

Browse files
committed
thermal: core: Drop unused .get_trip_*() callbacks
After recent changes in the ACPI thermal driver and in the Intel DTS IOSF thermal driver, all thermal zone drivers are expected to use trip tables for initialization and none of them should implement .get_trip_type(), .get_trip_temp() or .get_trip_hyst() callbacks, so drop these callbacks entirely from the core. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 9580dfb commit 35d8dbb

File tree

3 files changed

+4
-26
lines changed

3 files changed

+4
-26
lines changed

drivers/thermal/thermal_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1266,7 +1266,7 @@ thermal_zone_device_register_with_trips(const char *type, struct thermal_trip *t
12661266
return ERR_PTR(-EINVAL);
12671267
}
12681268

1269-
if (num_trips > 0 && (!ops->get_trip_type || !ops->get_trip_temp) && !trips)
1269+
if (num_trips > 0 && !trips)
12701270
return ERR_PTR(-EINVAL);
12711271

12721272
if (!thermal_class)

drivers/thermal/thermal_trip.c

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -101,29 +101,11 @@ void __thermal_zone_set_trips(struct thermal_zone_device *tz)
101101
int __thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id,
102102
struct thermal_trip *trip)
103103
{
104-
int ret;
105-
106-
if (!tz || trip_id < 0 || trip_id >= tz->num_trips || !trip)
104+
if (!tz || !tz->trips || trip_id < 0 || trip_id >= tz->num_trips || !trip)
107105
return -EINVAL;
108106

109-
if (tz->trips) {
110-
*trip = tz->trips[trip_id];
111-
return 0;
112-
}
113-
114-
if (tz->ops->get_trip_hyst) {
115-
ret = tz->ops->get_trip_hyst(tz, trip_id, &trip->hysteresis);
116-
if (ret)
117-
return ret;
118-
} else {
119-
trip->hysteresis = 0;
120-
}
121-
122-
ret = tz->ops->get_trip_temp(tz, trip_id, &trip->temperature);
123-
if (ret)
124-
return ret;
125-
126-
return tz->ops->get_trip_type(tz, trip_id, &trip->type);
107+
*trip = tz->trips[trip_id];
108+
return 0;
127109
}
128110
EXPORT_SYMBOL_GPL(__thermal_zone_get_trip);
129111

include/linux/thermal.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,7 @@ struct thermal_zone_device_ops {
6262
int (*set_trips) (struct thermal_zone_device *, int, int);
6363
int (*change_mode) (struct thermal_zone_device *,
6464
enum thermal_device_mode);
65-
int (*get_trip_type) (struct thermal_zone_device *, int,
66-
enum thermal_trip_type *);
67-
int (*get_trip_temp) (struct thermal_zone_device *, int, int *);
6865
int (*set_trip_temp) (struct thermal_zone_device *, int, int);
69-
int (*get_trip_hyst) (struct thermal_zone_device *, int, int *);
7066
int (*set_trip_hyst) (struct thermal_zone_device *, int, int);
7167
int (*get_crit_temp) (struct thermal_zone_device *, int *);
7268
int (*set_emul_temp) (struct thermal_zone_device *, int);

0 commit comments

Comments
 (0)