summaryrefslogtreecommitdiff
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2014-02-22 20:17:34 +0400
committerGuenter Roeck <linux@roeck-us.net>2014-03-03 20:01:06 +0400
commita41a8927e7adfa5de607d5bd43fa8fbbef44d6f2 (patch)
tree04582a857933f67aacc261595530049f51a64634 /drivers/hwmon
parent7276d55e62f79f2b81d2c414e48de43edea5aa78 (diff)
downloadlinux-a41a8927e7adfa5de607d5bd43fa8fbbef44d6f2.tar.xz
hwmon: (lm95245) Make temp2_crit_hyst read-only
The hysteresis register is shared among both temperature sensors. This means changing one also affects the other. To avoid confusion, established way to express this is to make only the first instance writable and keep all other instances as read-only. Otherwise users may be confused that changing the second writable value also affects the first, while it is more obvious that a writable value may affect a different read-only value. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Jean Delvare <jdelvare@suse.de>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/lm95245.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/hwmon/lm95245.c b/drivers/hwmon/lm95245.c
index acf36794e7e3..0ae0dfdafdff 100644
--- a/drivers/hwmon/lm95245.c
+++ b/drivers/hwmon/lm95245.c
@@ -395,8 +395,7 @@ static SENSOR_DEVICE_ATTR(temp1_crit_alarm, S_IRUGO, show_alarm, NULL,
static SENSOR_DEVICE_ATTR(temp2_input, S_IRUGO, show_input, NULL, 2);
static SENSOR_DEVICE_ATTR(temp2_crit, S_IWUSR | S_IRUGO, show_limit,
set_limit, 7);
-static SENSOR_DEVICE_ATTR(temp2_crit_hyst, S_IWUSR | S_IRUGO, show_crit_hyst,
- set_crit_hyst, 7);
+static SENSOR_DEVICE_ATTR(temp2_crit_hyst, S_IRUGO, show_crit_hyst, NULL, 7);
static SENSOR_DEVICE_ATTR(temp2_crit_alarm, S_IRUGO, show_alarm, NULL,
STATUS1_RTCRIT);
static SENSOR_DEVICE_ATTR(temp2_type, S_IWUSR | S_IRUGO, show_type,