compat: only define thermal backports if CONFIG_THERMAL is enabled
authorLuca Coelho <luciano.coelho@intel.com>
Sun, 18 Feb 2018 13:24:50 +0000 (15:24 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 23 Feb 2018 11:33:09 +0000 (12:33 +0100)
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 <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
backport/backport-include/linux/thermal.h
backport/compat/backport-4.3.c

index 108a8cfee44f616546e0dfc8c78889a7d292a509..8874e196264d3ddbc52221a04b4966b3acf8ae6d 100644 (file)
@@ -3,6 +3,7 @@
 #include_next <linux/thermal.h>
 #include <linux/version.h>
 
+#ifdef CONFIG_THERMAL
 #if LINUX_VERSION_IS_LESS(3,8,0)
 #include <linux/errno.h>
 
@@ -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 */
index 2d8a5e5b19aafaa4e2fed2f3a8589c585032a6f7..88be5720209b345a01dc91ef1fa586af4afb66a1 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/thermal.h>
 #include <linux/slab.h>
 
+#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)
 {