Florian Tobias Schandinat 85c5702ac0 viafb: fix i2c_transfer error handling
i2c_transfer returns negative errno on error and number of messages
processed on success. Just returning this value would give a poor
interface as it is not obvious that you must compare with 2 after reading
1 or n bytes and with 1 after writing 1 byte to determine if it was
successful. To avoid this error prone interface convert the error code
of a successful read/write to zero and all other non-negative values to
an negative error code.
This fixes a regression introduced by
	via: Rationalize vt1636 detection
which resulted in no longer detecting a VT1636 chip and therefore has
broken the output in configurations which contain this chip.

Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Acked-by: Jonathan Corbet <corbet@lwn.net>
Cc: Joseph Chan <JosephChan@via.com.tw>
Cc: stable@kernel.org
2010-09-24 02:15:11 +00:00
..
2010-05-25 08:07:08 -07:00
2010-05-25 08:07:08 -07:00
2009-04-01 08:59:32 -07:00
2009-01-12 20:56:32 +01:00
2009-12-16 07:20:04 -08:00
2010-05-03 15:42:58 +02:00
2009-05-06 16:36:10 -07:00
2010-05-25 08:07:08 -07:00
2010-05-25 08:07:09 -07:00
2010-08-05 21:58:26 +00:00
2010-02-27 18:31:16 +01:00
2010-02-27 18:31:14 +01:00
2010-03-12 15:52:34 -08:00
2010-05-25 08:07:09 -07:00
2010-05-27 09:12:42 -07:00
2010-05-25 08:07:09 -07:00
2010-02-09 11:13:56 +01:00
2010-02-27 18:31:13 +01:00
2010-02-27 18:31:13 +01:00
2010-05-25 08:07:08 -07:00
2010-05-25 08:07:08 -07:00
2010-05-25 08:07:08 -07:00