summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerge Semin <fancer.lancer@gmail.com>2025-10-25 14:25:26 +0300
committerSerge Semin <fancer.lancer@gmail.com>2026-08-06 02:31:03 +0300
commit45c90e8e44dcf2903cc4320a0d8ab20403b625dd (patch)
tree0d5612dd33c3051e54d037c0a32f9883f91534fe
parent9efaffc979cb5beb1115ef52895981942a3622a1 (diff)
downloadlinux-45c90e8e44dcf2903cc4320a0d8ab20403b625dd.tar.gz
linux-45c90e8e44dcf2903cc4320a0d8ab20403b625dd.zip
hwmon: bt1-pvt: Fix incorrect alarm attribute notification
If PVT alarms are enabled the driver gets to be capable to detect the converted value exceeding the specified thresholds. These events are supposed to be reported via the sysfs attributed like: {hwmon_temp,hwmon_in}_{min_alarm,max_alarm}. But even though the pvt_soft_isr() function correctly calls the hwmon_notify_event() method with a correct "pvt_sensor_info::{attr_min_alarm,attr_max_alarm}" field passed, the value of the later fields have been wrongly initialized in the macros PVT_SENSOR_INFO(). As a result the threshold events are now reported via the {hwmon_temp,hwmon_in}_{min,max} attributes, which is definitely wrong. Let's fix the inconsistency above by assigning a correct min/max-alarm attribute value to the pvt_sensor_info::{attr_min_alarm,attr_max_alarm} fields. Fixes: 87976ce2825d ("hwmon: Add Baikal-T1 PVT sensor driver") Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
-rw-r--r--drivers/hwmon/bt1-pvt.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hwmon/bt1-pvt.h b/drivers/hwmon/bt1-pvt.h
index 93b8dd5e7c944..64acc79e6af49 100644
--- a/drivers/hwmon/bt1-pvt.h
+++ b/drivers/hwmon/bt1-pvt.h
@@ -166,8 +166,8 @@ struct pvt_sensor_info {
.thres_sts_lo = PVT_INTR_ ##_thres## _LO, \
.thres_sts_hi = PVT_INTR_ ##_thres## _HI, \
.type = _type, \
- .attr_min_alarm = _type## _min, \
- .attr_max_alarm = _type## _max, \
+ .attr_min_alarm = _type## _min_alarm, \
+ .attr_max_alarm = _type## _max_alarm, \
}
/*