]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
hwmon: (ltc4282): Fix reset_history file permissions
authorNuno Sá <nuno.sa@analog.com>
Fri, 19 Dec 2025 16:11:05 +0000 (16:11 +0000)
committerGuenter Roeck <linux@roeck-us.net>
Fri, 19 Dec 2025 16:44:22 +0000 (08:44 -0800)
The reset_history attributes are write only. Hence don't report them as
readable just to return -EOPNOTSUPP later on.

Fixes: cbc29538dbf7 ("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>
drivers/hwmon/ltc4282.c

index b9cad89f2cd9a813ac5af2e8870367e7b867562c..db6534e6799113565da39a574ae5e949b528e7b7 100644 (file)
@@ -1000,8 +1000,9 @@ static umode_t ltc4282_in_is_visible(const struct ltc4282_state *st, u32 attr)
        case hwmon_in_max:
        case hwmon_in_min:
        case hwmon_in_enable:
-       case hwmon_in_reset_history:
                return 0644;
+       case hwmon_in_reset_history:
+               return 0200;
        default:
                return 0;
        }
@@ -1020,8 +1021,9 @@ static umode_t ltc4282_curr_is_visible(u32 attr)
                return 0444;
        case hwmon_curr_max:
        case hwmon_curr_min:
-       case hwmon_curr_reset_history:
                return 0644;
+       case hwmon_curr_reset_history:
+               return 0200;
        default:
                return 0;
        }
@@ -1039,8 +1041,9 @@ static umode_t ltc4282_power_is_visible(u32 attr)
                return 0444;
        case hwmon_power_max:
        case hwmon_power_min:
-       case hwmon_power_reset_history:
                return 0644;
+       case hwmon_power_reset_history:
+               return 0200;
        default:
                return 0;
        }