diff mbox series

[57/74] backport: don't call thermal_zone_device_register for 6.0+

Message ID 20240524190907.6300b3433e5a.I8f204514c641d4a58039ec6aa00029c5eca9e13e@changeid (mailing list archive)
State New
Headers show
Series backport updates from Intel | expand

Commit Message

Johannes Berg May 24, 2024, 5:08 p.m. UTC
From: Miri Korenblit <miriam.rachel.korenblit@intel.com>

the backport version ofthermal_zone_device_register_with_trips calls
thermal_zone_device_register, but this was removed in 6.6, and
thermal_zone_device_register_with_trips does exist in 6.0+,
just has one more argument. So for kernels of version 6.0+, the
backported version can call it with 0 as the extra argument.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/compat/backport-6.9.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
diff mbox series

Patch

diff --git a/backport/compat/backport-6.9.c b/backport/compat/backport-6.9.c
index 6ae485da3975..5a370756b75e 100644
--- a/backport/compat/backport-6.9.c
+++ b/backport/compat/backport-6.9.c
@@ -12,8 +12,21 @@  thermal_zone_device_register_with_trips(const char *type,
 					struct thermal_zone_params *tzp, int passive_delay,
 					int polling_delay)
 {
+#if LINUX_VERSION_IS_LESS(6,0,0)
 	return thermal_zone_device_register(type, num_trips, 0, devdata, ops, tzp,
 					    passive_delay, polling_delay);
+#else
+#undef thermal_trip
+#undef thermal_zone_device_register_with_trips
+	return thermal_zone_device_register_with_trips(type,
+						       (struct thermal_trip *)(void *) trips,
+						       num_trips,
+						       0, devdata,
+						       ops, tzp, passive_delay,
+						       polling_delay);
+#define thermal_trip backport_thermal_trip
+#define thermal_zone_device_register_with_trips LINUX_BACKPORT(thermal_zone_device_register_with_trips)
+#endif /* < 6,6,0 */
 }
 EXPORT_SYMBOL_GPL(thermal_zone_device_register_with_trips);
 #endif /* CONFIG_THERMAL */