diff mbox series

[2/2] power: supply: hwmon: Fix missing temp1_max_alarm attribute

Message ID 20240908185337.103696-2-hdegoede@redhat.com (mailing list archive)
State Handled Elsewhere, archived
Headers show
Series [6.11,regression,fix,1/2] power: supply: Drop use_cnt check from power_supply_property_is_writeable() | expand

Commit Message

Hans de Goede Sept. 8, 2024, 6:53 p.m. UTC
Temp channel 0 aka temp1 can have a temp1_max_alarm attribute for
power_supply devices which have a POWER_SUPPLY_PROP_TEMP_ALERT_MAX
property.

HWMON_T_MAX_ALARM was missing from power_supply_hwmon_info for
temp channel 0, causing the hwmon temp1_max_alarm attribute to be
missing from such power_supply devices.

Add this to power_supply_hwmon_info to fix this.

Fixes: f1d33ae806ec ("power: supply: remove duplicated argument in power_supply_hwmon_info")
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
The original code accidentally listed HWMON_T_MIN_ALARM twice instead
of having HWMON_T_MIN_ALARM + HWMON_T_MAX_ALARM. Commit f1d33ae806ec
fixed this the wrong way by removing the second MIN_ALARM.
---
 drivers/power/supply/power_supply_hwmon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/power/supply/power_supply_hwmon.c b/drivers/power/supply/power_supply_hwmon.c
index baacefbdf768..6fbbfb1c685e 100644
--- a/drivers/power/supply/power_supply_hwmon.c
+++ b/drivers/power/supply/power_supply_hwmon.c
@@ -318,7 +318,8 @@  static const struct hwmon_channel_info * const power_supply_hwmon_info[] = {
 			   HWMON_T_INPUT     |
 			   HWMON_T_MAX       |
 			   HWMON_T_MIN       |
-			   HWMON_T_MIN_ALARM,
+			   HWMON_T_MIN_ALARM |
+			   HWMON_T_MAX_ALARM,
 
 			   HWMON_T_LABEL     |
 			   HWMON_T_INPUT     |