]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (emc2103) fix unable to change fan pwm1_enable attribute
authorVishwas M <vishwas.reddy.vr@gmail.com>
Tue, 7 Jul 2020 14:27:47 +0000 (19:57 +0530)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 7 Jul 2020 14:54:32 +0000 (07:54 -0700)
commitfac736434cf9bf34b1bfe39827a289c70ff58de5
treee56ea91e623969100188556b572cb031bff6a051
parentca9f78843d7dfae31714485bbc907f373c05361b
hwmon: (emc2103) fix unable to change fan pwm1_enable attribute

This patch fixes a bug which does not let FAN mode to be changed from
sysfs(pwm1_enable). i.e pwm1_enable can not be set to 3, it will always
remain at 0.

This is caused because the device driver handles the result of
"read_u8_from_i2c(client, REG_FAN_CONF1, &conf_reg)" incorrectly. The
driver thinks an error has occurred if the (result != 0). This has been
fixed by changing the condition to (result < 0).

Signed-off-by: Vishwas M <vishwas.reddy.vr@gmail.com>
Link: https://lore.kernel.org/r/20200707142747.118414-1-vishwas.reddy.vr@gmail.com
Fixes: 35656743ba42 ("hwmon: Add driver for SMSC EMC2103 temperature monitor and fan controller")
Cc: stable@vger.kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/emc2103.c