1
0
Fork 0
remarkable-linux/drivers/i2c/muxes
Russell King 26eae206b7 i2c: mux: pca954x: fix i2c mux selection caching
commit 7f638c1cb0 upstream.

smbus functions return -ve on error, 0 on success.  However,
__i2c_transfer() have a different return signature - -ve on error, or
number of buffers transferred (which may be zero or greater.)

The upshot of this is that the sense of the test is reversed when using
the mux on a bus supporting the master_xfer method: we cache the value
and never retry if we fail to transfer any buffers, but if we succeed,
we clear the cached value.

Fix this by making pca954x_reg_write() return a negative error code for
all failure cases.

Fixes: 463e8f845c ("i2c: mux: pca954x: retry updating the mux selection on failure")
Acked-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-19 20:18:05 +01:00
..
Kconfig i2c: mux: fix up dependencies 2016-11-14 18:23:30 +01:00
Makefile i2c: mux: demux-pinctrl: add driver 2016-02-12 19:16:04 +01:00
i2c-arb-gpio-challenge.c i2c: mux: inform the i2c mux core about how it is used 2016-08-25 22:11:03 +02:00
i2c-demux-pinctrl.c i2c: mux: demux-pinctrl: make drivers with no pinctrl work again 2016-11-10 21:12:47 +01:00
i2c-mux-gpio.c i2c: mux: relax locking of the top i2c adapter during mux-locked muxing 2016-05-04 22:39:17 +02:00
i2c-mux-pca954x.c i2c: mux: pca954x: fix i2c mux selection caching 2017-01-19 20:18:05 +01:00
i2c-mux-pca9541.c i2c: pca9541: add device tree binding 2016-08-25 22:11:03 +02:00
i2c-mux-pinctrl.c i2c: mux: relax locking of the top i2c adapter during mux-locked muxing 2016-05-04 22:39:17 +02:00
i2c-mux-reg.c i2c: mux: reg: wrong condition checked for of_address_to_resource return value 2016-07-06 00:33:49 +09:00