[PATCH 37/38] backports: add thermal_zone_device_enable()
Johannes Berg <[email protected]> Tue, 11 Oct 2022 23:04:45 +0200
| Newsgroups | org.kernel.vger.backports |
|---|---|
| Message-ID | <20221011230356.89f59316624f.I356df6f58af39de37026dd4df86c21daa9f735b9@changeid> |
From: Johannes Berg <[email protected]> Signed-off-by: Johannes Berg <[email protected]> --- backport/backport-include/linux/thermal.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/backport/backport-include/linux/thermal.h b/backport/backport-include/linux/thermal.h index 8210facf3697..f0be1199c5e7 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) -- 2.37.3 -- To unsubscribe from this list: send the line "unsubscribe backports" in