Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwmon: (f75375s) Do not overwrite values read from registers

All bits in the values read from registers to be used for the next
write were getting overwritten, avoid doing so to not mess with the
current configuration.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
Cc: Riku Voipio <riku.voipio@iki.fi>
Cc: stable@kernel.org
Signed-off-by: Jean Delvare <khali@linux-fr.org>

authored by

Guillem Jover and committed by
Jean Delvare
c3b327d6 96f36408

+2 -2
+2 -2
drivers/hwmon/f75375s.c
··· 298 298 return -EINVAL; 299 299 300 300 fanmode = f75375_read8(client, F75375_REG_FAN_TIMER); 301 - fanmode = ~(3 << FAN_CTRL_MODE(nr)); 301 + fanmode &= ~(3 << FAN_CTRL_MODE(nr)); 302 302 303 303 switch (val) { 304 304 case 0: /* Full speed */ ··· 350 350 351 351 mutex_lock(&data->update_lock); 352 352 conf = f75375_read8(client, F75375_REG_CONFIG1); 353 - conf = ~(1 << FAN_CTRL_LINEAR(nr)); 353 + conf &= ~(1 << FAN_CTRL_LINEAR(nr)); 354 354 355 355 if (val == 0) 356 356 conf |= (1 << FAN_CTRL_LINEAR(nr)) ;