]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
thermal: core: Drop unused .get_trip_*() callbacks
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 29 Aug 2023 18:46:31 +0000 (20:46 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 29 Aug 2023 18:46:31 +0000 (20:46 +0200)
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>
drivers/thermal/thermal_core.c
drivers/thermal/thermal_trip.c
include/linux/thermal.h

index a59700593d326d3e04a3b1e5b158a32b098ee802..0bdde1ab5d8b8a7038b1ea2a297e84d40895ffb6 100644 (file)
@@ -1266,7 +1266,7 @@ thermal_zone_device_register_with_trips(const char *type, struct thermal_trip *t
                return ERR_PTR(-EINVAL);
        }
 
-       if (num_trips > 0 && (!ops->get_trip_type || !ops->get_trip_temp) && !trips)
+       if (num_trips > 0 && !trips)
                return ERR_PTR(-EINVAL);
 
        if (!thermal_class)
index 53115cfdfd42a4318f52d648913c1043aa8d4c5c..024e2e365a26b60d8ef73c3bffa2053e90f818fb 100644 (file)
@@ -101,29 +101,11 @@ void __thermal_zone_set_trips(struct thermal_zone_device *tz)
 int __thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id,
                            struct thermal_trip *trip)
 {
-       int ret;
-
-       if (!tz || trip_id < 0 || trip_id >= tz->num_trips || !trip)
+       if (!tz || !tz->trips || trip_id < 0 || trip_id >= tz->num_trips || !trip)
                return -EINVAL;
 
-       if (tz->trips) {
-               *trip = tz->trips[trip_id];
-               return 0;
-       }
-
-       if (tz->ops->get_trip_hyst) {
-               ret = tz->ops->get_trip_hyst(tz, trip_id, &trip->hysteresis);
-               if (ret)
-                       return ret;
-       } else {
-               trip->hysteresis = 0;
-       }
-
-       ret = tz->ops->get_trip_temp(tz, trip_id, &trip->temperature);
-       if (ret)
-               return ret;
-
-       return tz->ops->get_trip_type(tz, trip_id, &trip->type);
+       *trip = tz->trips[trip_id];
+       return 0;
 }
 EXPORT_SYMBOL_GPL(__thermal_zone_get_trip);
 
index b449a46766f5a34535fc121d40afdd5a72c19ea0..e6bd3b7c9eda58a31fb8eafdc90128e05f80c0b1 100644 (file)
@@ -62,11 +62,7 @@ struct thermal_zone_device_ops {
        int (*set_trips) (struct thermal_zone_device *, int, int);
        int (*change_mode) (struct thermal_zone_device *,
                enum thermal_device_mode);
-       int (*get_trip_type) (struct thermal_zone_device *, int,
-               enum thermal_trip_type *);
-       int (*get_trip_temp) (struct thermal_zone_device *, int, int *);
        int (*set_trip_temp) (struct thermal_zone_device *, int, int);
-       int (*get_trip_hyst) (struct thermal_zone_device *, int, int *);
        int (*set_trip_hyst) (struct thermal_zone_device *, int, int);
        int (*get_crit_temp) (struct thermal_zone_device *, int *);
        int (*set_emul_temp) (struct thermal_zone_device *, int);