summaryrefslogtreecommitdiffstats
path: root/drivers/thermal/thermal_sysfs.c
diff options
context:
space:
mode:
authorEduardo Valentin <edubezval@gmail.com>2016-11-08 06:09:18 +0100
committerZhang Rui <rui.zhang@intel.com>2016-11-23 03:06:12 +0100
commit698db4fdd3e8ef65db2cbde447443c1dc5807b95 (patch)
treed948e4ee16a1a09e63b0b0062b1af2ee97fcf423 /drivers/thermal/thermal_sysfs.c
parentthermal: core: add a comment describing the device management section (diff)
downloadlinux-698db4fdd3e8ef65db2cbde447443c1dc5807b95.tar.xz
linux-698db4fdd3e8ef65db2cbde447443c1dc5807b95.zip
thermal: sysfs: remove symbols of emul_temp when config is disabled
Remove the following warning: In file included from drivers/thermal/thermal_sysfs.c:19:0: include/linux/device.h:575:26: warning: ‘dev_attr_emul_temp’ defined but not used [-Wunused-variable] struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store) ^ drivers/thermal/thermal_sysfs.c:395:8: note: in expansion of macro ‘DEVICE_ATTR’ when emul temp is disabled at Kconfig. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Diffstat (limited to 'drivers/thermal/thermal_sysfs.c')
-rw-r--r--drivers/thermal/thermal_sysfs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c
index 87d9f4d3afaf..4807015c26de 100644
--- a/drivers/thermal/thermal_sysfs.c
+++ b/drivers/thermal/thermal_sysfs.c
@@ -292,6 +292,7 @@ available_policies_show(struct device *dev, struct device_attribute *devattr,
return thermal_build_list_of_policies(buf);
}
+#if (IS_ENABLED(CONFIG_THERMAL_EMULATION))
static ssize_t
emul_temp_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
@@ -316,6 +317,8 @@ emul_temp_store(struct device *dev, struct device_attribute *attr,
return ret ? ret : count;
}
+static DEVICE_ATTR(emul_temp, S_IWUSR, NULL, emul_temp_store);
+#endif
static ssize_t
sustainable_power_show(struct device *dev, struct device_attribute *devattr,
@@ -395,7 +398,6 @@ create_s32_tzp_attr(offset);
*/
static DEVICE_ATTR(type, 0444, type_show, NULL);
static DEVICE_ATTR(temp, 0444, temp_show, NULL);
-static DEVICE_ATTR(emul_temp, S_IWUSR, NULL, emul_temp_store);
static DEVICE_ATTR(policy, S_IRUGO | S_IWUSR, policy_show, policy_store);
static DEVICE_ATTR(available_policies, S_IRUGO, available_policies_show, NULL);
static DEVICE_ATTR(sustainable_power, S_IWUSR | S_IRUGO, sustainable_power_show,