aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorGuenter Roeck <guenter.roeck@ericsson.com>2011-12-08 13:01:25 -0500
committerGuenter Roeck <guenter.roeck@ericsson.com>2012-01-05 11:19:30 -0500
commit3310600aa7bc11ead9b0324b972d13fb0e91bcaf (patch)
treef9dcb81de745d403ea902789142fa8d26e01364e /drivers/hwmon
parent740f6be3ccc885ca103c90c48d3b3066239c585c (diff)
hwmon: (f75375s) Fix value range for PWM modes
Accepted value range for PWM modes was 0..4, even though only 0..3 is subsequently used. Limit permitted value range to 0..3 to avoid unpredictable behavior. Cc: Riku Voipio <riku.voipio@iki.fi> Reviewed-by: Bjoern Gerhart <oss@extracloud.de> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/f75375s.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c
index 316c29a0b318..777a665164f9 100644
--- a/drivers/hwmon/f75375s.c
+++ b/drivers/hwmon/f75375s.c
@@ -309,7 +309,7 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val)
309 struct f75375_data *data = i2c_get_clientdata(client); 309 struct f75375_data *data = i2c_get_clientdata(client);
310 u8 fanmode; 310 u8 fanmode;
311 311
312 if (val < 0 || val > 4) 312 if (val < 0 || val > 3)
313 return -EINVAL; 313 return -EINVAL;
314 314
315 fanmode = f75375_read8(client, F75375_REG_FAN_TIMER); 315 fanmode = f75375_read8(client, F75375_REG_FAN_TIMER);