summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/dell-smm-hwmon.c
diff options
context:
space:
mode:
authorArmin Wolf <W_Armin@gmx.de>2021-07-29 00:15:57 +0200
committerGuenter Roeck <linux@roeck-us.net>2021-08-17 23:54:26 +0200
commit2757269a7defe96e871be795b680b602efb877ce (patch)
tree748c1f20eb4fc909ebb4d0fbba06cd22b190ec1f /drivers/hwmon/dell-smm-hwmon.c
parenthwmon: (dell-smm-hwmon) Convert to devm_hwmon_device_register_with_info() (diff)
downloadlinux-2757269a7defe96e871be795b680b602efb877ce.tar.xz
linux-2757269a7defe96e871be795b680b602efb877ce.zip
hwmon: (dell-smm-hwmon) Fix fan mutliplier detection for 3rd fan
There are up to three fans, but the detection omits the 3rd one. Fix that by using DELL_SMM_NO_FANS. Signed-off-by: Armin Wolf <W_Armin@gmx.de> Fixes: 747bc8b063ae (hwmon: (dell-smm) Detect fan with index=2) Link: https://lore.kernel.org/r/20210728221557.8891-7-W_Armin@gmx.de Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/dell-smm-hwmon.c')
-rw-r--r--drivers/hwmon/dell-smm-hwmon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c
index aaf864dbe53a..206418405440 100644
--- a/drivers/hwmon/dell-smm-hwmon.c
+++ b/drivers/hwmon/dell-smm-hwmon.c
@@ -1263,7 +1263,7 @@ static int __init dell_smm_probe(struct platform_device *pdev)
* Autodetect fan multiplier based on nominal rpm
* If fan reports rpm value too high then set multiplier to 1
*/
- for (fan = 0; fan < 2; ++fan) {
+ for (fan = 0; fan < DELL_SMM_NO_FANS; ++fan) {
ret = i8k_get_fan_nominal_speed(data, fan, data->i8k_fan_max);
if (ret < 0)
continue;