]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.0-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 12 Aug 2013 04:03:56 +0000 (21:03 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 12 Aug 2013 04:03:56 +0000 (21:03 -0700)
added patches:
hwmon-adt7470-fix-incorrect-return-code-check.patch

queue-3.0/hwmon-adt7470-fix-incorrect-return-code-check.patch [new file with mode: 0644]
queue-3.0/series [new file with mode: 0644]

diff --git a/queue-3.0/hwmon-adt7470-fix-incorrect-return-code-check.patch b/queue-3.0/hwmon-adt7470-fix-incorrect-return-code-check.patch
new file mode 100644 (file)
index 0000000..9023504
--- /dev/null
@@ -0,0 +1,42 @@
+From 93d783bcca69bfacc8dc739d8a050498402587b5 Mon Sep 17 00:00:00 2001
+From: Curt Brune <curt@cumulusnetworks.com>
+Date: Thu, 8 Aug 2013 12:11:03 -0700
+Subject: hwmon: (adt7470) Fix incorrect return code check
+
+From: Curt Brune <curt@cumulusnetworks.com>
+
+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 |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/hwmon/adt7470.c
++++ b/drivers/hwmon/adt7470.c
+@@ -215,7 +215,7 @@ static inline int adt7470_write_word_dat
+                                         u16 value)
+ {
+       return i2c_smbus_write_byte_data(client, reg, value & 0xFF)
+-             && i2c_smbus_write_byte_data(client, reg + 1, value >> 8);
++             || i2c_smbus_write_byte_data(client, reg + 1, value >> 8);
+ }
+ static void adt7470_init_client(struct i2c_client *client)
diff --git a/queue-3.0/series b/queue-3.0/series
new file mode 100644 (file)
index 0000000..2fa1a53
--- /dev/null
@@ -0,0 +1 @@
+hwmon-adt7470-fix-incorrect-return-code-check.patch