summaryrefslogtreecommitdiff
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2023-06-02 00:31:54 +0300
committerGuenter Roeck <linux@roeck-us.net>2023-06-08 16:42:53 +0300
commit153c9a023b1f455887a3fb7913207794eee3c6c2 (patch)
treea1338b89b073704d0f673c187f3c3abc8c0437e9 /drivers/hwmon
parent23902f98f8d4811ab84dde6419569a5b374f8122 (diff)
downloadlinux-153c9a023b1f455887a3fb7913207794eee3c6c2.tar.xz
hwmon: (hp-wmi-sensors) fix debugfs check
Checking for Kconfig symbols with #if is wrong: drivers/hwmon/hp-wmi-sensors.c:1141:5: error: "CONFIG_DEBUG_FS" is not defined, evaluates to 0 [-Werror=undef] This could be an #ifdef, but an IS_ENABLED() check is even better to give the best compile coverage. Fixes: 23902f98f8d4 ("hwmon: add HP WMI Sensors driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: James Seo <james@equiv.tech> Link: https://lore.kernel.org/r/20230601213216.3220550-1-arnd@kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/hp-wmi-sensors.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/hwmon/hp-wmi-sensors.c b/drivers/hwmon/hp-wmi-sensors.c
index 7218945bd03f..ebe2fb513480 100644
--- a/drivers/hwmon/hp-wmi-sensors.c
+++ b/drivers/hwmon/hp-wmi-sensors.c
@@ -1138,8 +1138,6 @@ out_unlock:
return ret;
}
-#if CONFIG_DEBUG_FS
-
static int basic_string_show(struct seq_file *seqf, void *ignored)
{
const char *str = seqf->private;
@@ -1341,16 +1339,6 @@ static void hp_wmi_debugfs_init(struct device *dev, struct hp_wmi_info *info,
}
}
-#else
-
-static void hp_wmi_debugfs_init(struct device *dev, struct hp_wmi_info *info,
- struct hp_wmi_platform_events *pevents,
- u8 icount, u8 pcount, bool is_new)
-{
-}
-
-#endif
-
static umode_t hp_wmi_hwmon_is_visible(const void *drvdata,
enum hwmon_sensor_types type,
u32 attr, int channel)
@@ -1959,7 +1947,8 @@ static int hp_wmi_sensors_init(struct hp_wmi_sensors *state)
if (err)
return err;
- hp_wmi_debugfs_init(dev, info, pevents, icount, pcount, is_new);
+ if (IS_ENABLED(CONFIG_DEBUG_FS))
+ hp_wmi_debugfs_init(dev, info, pevents, icount, pcount, is_new);
if (!count)
return 0; /* No connected sensors; debugfs only. */