@@ -14,8 +14,8 @@ static inline int thermal_zone_device_disable(struct thermal_zone_device *tz)
{ return 0; }
#endif /* < 5.9 */
-#if LINUX_VERSION_IS_LESS(6,9,0) && LINUX_VERSION_IS_GEQ(5,10,0)
-struct thermal_trip {
+#if LINUX_VERSION_IS_LESS(6,9,0)
+struct backport_thermal_trip {
int temperature;
int hysteresis;
int threshold;
@@ -23,10 +23,11 @@ struct thermal_trip {
u8 flags;
void *priv;
};
-#endif
+#define thermal_trip backport_thermal_trip
-#if LINUX_VERSION_IS_LESS(6,9,0)
#define THERMAL_TRIP_FLAG_RW_TEMP BIT(0)
+
+#define thermal_zone_device_register_with_trips LINUX_BACKPORT(thermal_zone_device_register_with_trips)
struct thermal_zone_device *
thermal_zone_device_register_with_trips(const char *type,
struct thermal_trip *trips,
@@ -37,15 +38,18 @@ thermal_zone_device_register_with_trips(const char *type,
int polling_delay);
#endif /* <6,9,0 */
-#if LINUX_VERSION_IS_LESS(6,6,0) && LINUX_VERSION_IS_GEQ(6,0,0)
+#if LINUX_VERSION_IS_LESS(6,9,0) && LINUX_VERSION_IS_GEQ(6,0,0)
+#define for_each_thermal_trip LINUX_BACKPORT(for_each_thermal_trip)
static inline
int for_each_thermal_trip(struct thermal_zone_device *tz,
int (*cb)(struct thermal_trip *, void *),
void *data)
{
+ struct thermal_trip *trip;
+ struct thermal_trip *trips = (void *)tz->trips;
int ret;
- for (trip = tz->trips; trip - tz->trips < tz->num_trips; trip++) {
+ for (trip = trips; trip - trips < tz->num_trips; trip++) {
ret = cb(trip, data);
if (ret)
return ret;
@@ -53,7 +57,7 @@ int for_each_thermal_trip(struct thermal_zone_device *tz,
return 0;
}
-#endif /* < 6,6,0 && >= 6,0,0 */
+#endif /* < 6,9,0 && >= 6,0,0 */
/* for < 6,0,0 the trips are invalid anyway*/
#if LINUX_VERSION_IS_LESS(6,0,0)