[PATCH] hwmon: (vexpress) use IS_ENABLED() for CONFIG_REGULATOR_VEXPRESS
Pengpeng Hou
hppiscas at 163.com
Thu Dec 3 18:22:40 PST 2026
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")
Signed-off-by: Pengpeng Hou <hppiscas at 163.com>
---
The original patch was prepared with Gemini. Codex assisted with this
review and revision (Assisted-by: gpt 5).
Built vexpress-hwmon.o for arm64 with Clang 18 and W=1, with
SENSORS_VEXPRESS=m and REGULATOR_VEXPRESS=m. The arm,vexpress-volt
string was present before the change and absent afterwards;
arm,vexpress-temp remained present. No board was used.
drivers/hwmon/vexpress-hwmon.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/hwmon/vexpress-hwmon.c b/drivers/hwmon/vexpress-hwmon.c
index d38ac040eeee4ae529e034c86a17639e01c27a1f..a1da17c245712ca8aa6d148c98c31e850f6781c4 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,
base-commit: d06ce6f1eb5eeffd4ebcfde345dc34a98131d106
More information about the linux-arm-kernel
mailing list