diff mbox series

[30/75] backports: add thermal_zone_device_enable()

Message ID 20240627234808.1253337-31-hauke@hauke-m.de (mailing list archive)
State New, archived
Headers show
Series backports: Update to kernel 6.1.95 | expand

Commit Message

Hauke Mehrtens June 27, 2024, 11:47 p.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/thermal.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff mbox series

Patch

diff --git a/backport/backport-include/linux/thermal.h b/backport/backport-include/linux/thermal.h
index d9b8153e..f1663eff 100644
--- a/backport/backport-include/linux/thermal.h
+++ b/backport/backport-include/linux/thermal.h
@@ -3,6 +3,18 @@ 
 #include_next <linux/thermal.h>
 #include <linux/version.h>
 
+#ifdef CONFIG_THERMAL
+#if LINUX_VERSION_IS_LESS(5,9,0)
+static inline int thermal_zone_device_enable(struct thermal_zone_device *tz)
+{ return 0; }
+#endif /* < 5.9.0 */
+#else /* CONFIG_THERMAL */
+#if LINUX_VERSION_IS_LESS(5,9,0)
+static inline int thermal_zone_device_enable(struct thermal_zone_device *tz)
+{ return -ENODEV; }
+#endif /* < 5.9.0 */
+#endif /* CONFIG_THERMAL */
+
 #if LINUX_VERSION_IS_LESS(5,9,0)
 #define thermal_zone_device_enable LINUX_BACKPORT(thermal_zone_device_enable)
 static inline int thermal_zone_device_enable(struct thermal_zone_device *tz)