@@ -13,6 +13,10 @@ static inline int thermal_zone_device_enable(struct thermal_zone_device *tz)
static inline int thermal_zone_device_disable(struct thermal_zone_device *tz)
{ return 0; }
#endif /* < 5.9 */
+
+#if LINUX_VERSION_IS_LESS(6,4,0)
+void *thermal_zone_device_priv(struct thermal_zone_device *tzd);
+#endif /* < 6.4.0 */
#else /* CONFIG_THERMAL */
#if LINUX_VERSION_IS_LESS(5,9,0)
#define thermal_zone_device_enable LINUX_BACKPORT(thermal_zone_device_enable)
@@ -23,6 +27,14 @@ static inline int thermal_zone_device_enable(struct thermal_zone_device *tz)
static inline int thermal_zone_device_disable(struct thermal_zone_device *tz)
{ return -ENODEV; }
#endif /* < 5.9 */
+
+#if LINUX_VERSION_IS_LESS(6,4,0)
+#define thermal_zone_device_priv LINUX_BACKPORT(thermal_zone_device_priv)
+static inline void *thermal_zone_device_priv(struct thermal_zone_device *tzd)
+{
+ return NULL;
+}
+#endif /* < 6.4.0 */
#endif /* CONFIG_THERMAL */
#endif /* __BACKPORT_LINUX_THERMAL_H */
@@ -3,6 +3,7 @@
#include <linux/types.h>
#include <linux/netdevice.h>
#include <net/dropreason.h>
+#include <linux/thermal.h>
#if LINUX_VERSION_IS_GEQ(6,2,0) && defined(CONFIG_KUNIT)
#include <kunit/test.h>
@@ -53,3 +54,11 @@ EXPORT_SYMBOL_GPL(drop_reasons_register_subsys);
void drop_reasons_unregister_subsys(enum skb_drop_reason_subsys subsys)
{}
EXPORT_SYMBOL_GPL(drop_reasons_unregister_subsys);
+
+#ifdef CONFIG_THERMAL
+void *thermal_zone_device_priv(struct thermal_zone_device *tzd)
+{
+ return tzd->devdata;
+}
+EXPORT_SYMBOL_GPL(thermal_zone_device_priv);
+#endif /* CONFIG_THERMAL */