]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
hwmon: (lm90) Fix usage of CONFIG2 register in detect function
authorGuenter Roeck <linux@roeck-us.net>
Sat, 6 Nov 2021 17:02:44 +0000 (10:02 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Dec 2021 11:17:34 +0000 (12:17 +0100)
commit7e13a3b81ffa158993d25ffb55ca94d96fa2cd42
tree7b2a2d07f92b1e9322f54702dbe2e1b081b05d1d
parent156e03cf98aa56a3beed09f5c7d50cd1c0225e88
hwmon: (lm90) Fix usage of CONFIG2 register in detect function

[ Upstream commit fce15c45d3fbd9fc1feaaf3210d8e3f8b33dfd3a ]

The detect function had a comment "Make compiler happy" when id did not
read the second configuration register. As it turns out, the code was
checking the contents of this register for manufacturer ID 0xA1 (NXP
Semiconductor/Philips), but never actually read the register. So it
wasn't surprising that the compiler complained, and it indeed had a point.
Fix the code to read the register contents for manufacturer ID 0xa1.

At the same time, the code was reading the register for manufacturer ID
0x41 (Analog Devices), but it was not using the results. In effect it was
just checking if reading the register returned an error. That doesn't
really add much if any value, so stop doing that.

Fixes: f90be42fb383 ("hwmon: (lm90) Refactor reading of config2 register")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hwmon/lm90.c