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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Miri Korenblit <miriam.rachel.korenblit@xxxxxxxxx>

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@xxxxxxxxx>
Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
---
 backport/compat/backport-6.9.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

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 */
-- 
2.45.1





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux