]> git.karo-electronics.de Git - karo-tx-linux.git/commit
hwmon: (adt7470) Fix incorrect return code check
authorCurt Brune <curt@cumulusnetworks.com>
Thu, 8 Aug 2013 19:11:03 +0000 (12:11 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Aug 2013 05:59:06 +0000 (22:59 -0700)
commit334428c3b3ad6e9007e370dc59dc1889abaa2222
treeba6c53e85942ad9679b4222c55fd028d10e22316
parent9300766810ffff36c2db8efc2fe7c7a6c0469129
hwmon: (adt7470) Fix incorrect return code check

commit 93d783bcca69bfacc8dc739d8a050498402587b5 upstream.

In adt7470_write_word_data(), which writes two bytes using
i2c_smbus_write_byte_data(), the return codes are incorrectly AND-ed
together when they should be OR-ed together.

The return code of i2c_smbus_write_byte_data() is zero for success.

The upshot is only the first byte was ever written to the hardware.
The 2nd byte was never written out.

I noticed that trying to set the fan speed limits was not working
correctly on my system.  Setting the fan speed limits is the only
code that uses adt7470_write_word_data().  After making the change
the limit settings work and the alarms work also.

Signed-off-by: Curt Brune <curt@cumulusnetworks.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwmon/adt7470.c