Commit 555a26ea851f for kernel
commit 555a26ea851f1cc1d494e4f270d7622681bbd535
Author: Pengpeng Hou <hppiscas@163.com>
Date: Fri Dec 4 10:22:40 2026 +0800
hwmon: (vexpress) use IS_ENABLED() for CONFIG_REGULATOR_VEXPRESS
Both the Versatile Express regulator and hwmon drivers match the voltage
node. The hwmon driver is intended to expose voltage only when the
regulator driver is not configured; its current guard still claims
voltage when the regulator is modular.
Use IS_ENABLED for the voltage attributes and match entry. The other
hwmon sensors remain available.
The issue was found by our static-analysis tool and manually reviewed.
Fixes: 48ed88772446 ("hwmon: Versatile Express hwmon driver")
Cc: stable@vger.kernel.org
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
Link: https://patch.msgid.link/179635096045.74470.14679551183623100373@163.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
diff --git a/drivers/hwmon/vexpress-hwmon.c b/drivers/hwmon/vexpress-hwmon.c
index d38ac040eeee..a1da17c24571 100644
--- a/drivers/hwmon/vexpress-hwmon.c
+++ b/drivers/hwmon/vexpress-hwmon.c
@@ -83,7 +83,7 @@ struct vexpress_hwmon_type {
const struct attribute_group **attr_groups;
};
-#if !defined(CONFIG_REGULATOR_VEXPRESS)
+#if !IS_ENABLED(CONFIG_REGULATOR_VEXPRESS)
static DEVICE_ATTR(in1_label, 0444, vexpress_hwmon_label_show, NULL);
static SENSOR_DEVICE_ATTR_RO(in1_input, vexpress_hwmon_u32, 1000);
static struct attribute *vexpress_hwmon_attrs_volt[] = {
@@ -181,7 +181,7 @@ static struct vexpress_hwmon_type vexpress_hwmon_energy = {
};
static const struct of_device_id vexpress_hwmon_of_match[] = {
-#if !defined(CONFIG_REGULATOR_VEXPRESS)
+#if !IS_ENABLED(CONFIG_REGULATOR_VEXPRESS)
{
.compatible = "arm,vexpress-volt",
.data = &vexpress_hwmon_volt,