From 783d3c5354b91d6432185c99cfb48f34120b2da5 Mon Sep 17 00:00:00 2001 From: Luca Coelho Date: Sun, 18 Feb 2018 15:24:50 +0200 Subject: compat: only define thermal backports if CONFIG_THERMAL is enabled If CONFIG_THERMAL is not enabled, we don't have to add all backports for the thermal framework. Actually this doesn't even work because we try to use thermal_zone_device_register/unregister and they are not present in the outer kernel, causing undefined symbols warnings: WARNING: "thermal_zone_device_register" [/home/luca/iwlwifi/stack-dev/compat/compat.ko] undefined! WARNING: "thermal_zone_device_unregister" [/home/luca/iwlwifi/stack-dev/compat/compat.ko] undefined! Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg --- backport/backport-include/linux/thermal.h | 2 ++ backport/compat/backport-4.3.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/backport/backport-include/linux/thermal.h b/backport/backport-include/linux/thermal.h index 108a8cfe..8874e196 100644 --- a/backport/backport-include/linux/thermal.h +++ b/backport/backport-include/linux/thermal.h @@ -3,6 +3,7 @@ #include_next #include +#ifdef CONFIG_THERMAL #if LINUX_VERSION_IS_LESS(3,8,0) #include @@ -110,5 +111,6 @@ void backport_thermal_zone_device_unregister(struct thermal_zone_device *); #endif /* LINUX_VERSION_IS_LESS(4,3,0) */ #endif /* ! < 3.8.0 */ +#endif /* CONFIG_THERMAL */ #endif /* __BACKPORT_LINUX_THERMAL_H */ diff --git a/backport/compat/backport-4.3.c b/backport/compat/backport-4.3.c index 2d8a5e5b..88be5720 100644 --- a/backport/compat/backport-4.3.c +++ b/backport/compat/backport-4.3.c @@ -16,6 +16,7 @@ #include #include +#ifdef CONFIG_THERMAL #if LINUX_VERSION_IS_GEQ(3,8,0) struct backport_thermal_ops_wrapper { old_thermal_zone_device_ops_t ops; @@ -171,6 +172,7 @@ void backport_thermal_zone_device_unregister(struct thermal_zone_device *dev) EXPORT_SYMBOL_GPL(backport_thermal_zone_device_unregister); #endif /* >= 3.8.0 */ +#endif /* CONFIG_THERMAL */ static void seq_set_overflow(struct seq_file *m) { -- cgit v1.2.3