Skip to content

Commit b3db91c

Browse files
nunojsagroeck
authored andcommitted
hwmon: (ltc4282): Fix reset_history file permissions
The reset_history attributes are write only. Hence don't report them as readable just to return -EOPNOTSUPP later on. Fixes: cbc2953 ("hwmon: Add driver for LTC4282") Signed-off-by: Nuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20251219-ltc4282-fix-reset-history-v1-1-8eab974c124b@analog.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1 parent 6cde588 commit b3db91c

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

drivers/hwmon/ltc4282.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,8 +1000,9 @@ static umode_t ltc4282_in_is_visible(const struct ltc4282_state *st, u32 attr)
10001000
case hwmon_in_max:
10011001
case hwmon_in_min:
10021002
case hwmon_in_enable:
1003-
case hwmon_in_reset_history:
10041003
return 0644;
1004+
case hwmon_in_reset_history:
1005+
return 0200;
10051006
default:
10061007
return 0;
10071008
}
@@ -1020,8 +1021,9 @@ static umode_t ltc4282_curr_is_visible(u32 attr)
10201021
return 0444;
10211022
case hwmon_curr_max:
10221023
case hwmon_curr_min:
1023-
case hwmon_curr_reset_history:
10241024
return 0644;
1025+
case hwmon_curr_reset_history:
1026+
return 0200;
10251027
default:
10261028
return 0;
10271029
}
@@ -1039,8 +1041,9 @@ static umode_t ltc4282_power_is_visible(u32 attr)
10391041
return 0444;
10401042
case hwmon_power_max:
10411043
case hwmon_power_min:
1042-
case hwmon_power_reset_history:
10431044
return 0644;
1045+
case hwmon_power_reset_history:
1046+
return 0200;
10441047
default:
10451048
return 0;
10461049
}

0 commit comments

Comments
 (0)