hwmon: (dell-smm) Avoid unnecessary SMM calls during init
authorArmin Wolf <W_Armin@gmx.de>
Tue, 26 Apr 2022 21:31:52 +0000 (23:31 +0200)
committerGuenter Roeck <linux@roeck-us.net>
Fri, 20 May 2022 17:57:05 +0000 (10:57 -0700)
commit4fc1a51c8572179abb767f56cbfc433e00e310c1
treef392aa8d55f9afb745407ea63d7e3b0dd33f6bad
parentc851b715d38de0c262a63de16ad954ed39b47aca
hwmon: (dell-smm) Avoid unnecessary SMM calls during init

When the driver tries to detect the fan multiplier during
module initialisation, it issues one SMM call for each fan.
Those SMM calls are however redundant and also try to query
fans which may not be present.
Fix that by detecting the fan multiplier during hwmon
initialisation when no extra SMM calls are needed.
Also dont assume the last nominal speed entry to be the
biggest and instead check all entries.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20220426213154.724708-2-W_Armin@gmx.de
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/dell-smm-hwmon.c