[PATCH 24/47] headers: Adapt signature of thermal_zone_device_update()

Hauke Mehrtens <[email protected]>
Newsgroups org.kernel.vger.backports
Message-ID <[email protected]>
The function signature of thermal_zone_device_update() function changed
in kernel 4.9. Drop the event parameter for older kernel versions. This
function is used by iwlwifi.
The code was partly copied from the upstream kernel.

Signed-off-by: Hauke Mehrtens <[email protected]>
---
 backport/backport-include/linux/thermal.h | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/backport/backport-include/linux/thermal.h b/backport/backport-include/linux/thermal.h
index d9b8153e..8210facf 100644
--- a/backport/backport-include/linux/thermal.h
+++ b/backport/backport-include/linux/thermal.h
@@ -13,4 +13,27 @@ static inline int thermal_zone_device_disable(struct thermal_zone_device *tz)
 { return 0; }
 #endif /* < 5.9 */
 
+#if LINUX_VERSION_IS_LESS(4,9,0)
+/* Thermal notification reason */
+enum thermal_notify_event {
+	THERMAL_EVENT_UNSPECIFIED, /* Unspecified event */
+	THERMAL_EVENT_TEMP_SAMPLE, /* New Temperature sample */
+	THERMAL_TRIP_VIOLATED, /* TRIP Point violation */
+	THERMAL_TRIP_CHANGED, /* TRIP Point temperature changed */
+	THERMAL_DEVICE_DOWN, /* Thermal device is down */
+	THERMAL_DEVICE_UP, /* Thermal device is up after a down event */
+	THERMAL_DEVICE_POWER_CAPABILITY_CHANGED, /* power capability changed */
+	THERMAL_TABLE_CHANGED, /* Thermal table(s) changed */
+	THERMAL_EVENT_KEEP_ALIVE, /* Request for user space handler to respond */
+};
+
+static inline void
+backport_thermal_zone_device_update(struct thermal_zone_device *tz,
+				    enum thermal_notify_event event)
+{
+	thermal_zone_device_update(tz);
+}
+#define thermal_zone_device_update LINUX_BACKPORT(thermal_zone_device_update)
+#endif /* < 4.9 */
+
 #endif /* __BACKPORT_LINUX_THERMAL_H */
-- 
2.30.2

--
To unsubscribe from this list: send the line "unsubscribe backports" in
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.