summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/nct6775-core.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 10:10:26 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 10:10:26 +0000
commit116e0f61852489520aaad930b8fcbe40834819bf (patch)
treee7cd8828fee4cf285d0b49d2eccc532ac1c064af /drivers/hwmon/nct6775-core.c
parentReleasing progress-linux version 6.1.76-1~progress6.99u1. (diff)
downloadlinux-116e0f61852489520aaad930b8fcbe40834819bf.tar.xz
linux-116e0f61852489520aaad930b8fcbe40834819bf.zip
Merging upstream version 6.1.82.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--drivers/hwmon/nct6775-core.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/hwmon/nct6775-core.c b/drivers/hwmon/nct6775-core.c
index 80310845f..9720ad214 100644
--- a/drivers/hwmon/nct6775-core.c
+++ b/drivers/hwmon/nct6775-core.c
@@ -2462,6 +2462,13 @@ store_pwm(struct device *dev, struct device_attribute *attr, const char *buf,
int err;
u16 reg;
+ /*
+ * The fan control mode should be set to manual if the user wants to adjust
+ * the fan speed. Otherwise, it will fail to set.
+ */
+ if (index == 0 && data->pwm_enable[nr] > manual)
+ return -EBUSY;
+
err = kstrtoul(buf, 10, &val);
if (err < 0)
return err;