diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-20 11:25:44 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-20 11:25:44 -0400 |
commit | af52739b922f656eb1f39016fabaabe4baeda2e2 (patch) | |
tree | 79a7aa810d0493cd0cf4adebac26d37f12e8b545 /drivers/i2c/busses/i2c-octeon.c | |
parent | 25ed6a5e97809129a1bc852b6b5c7d03baa112c4 (diff) | |
parent | 33688abb2802ff3a230bd2441f765477b94cc89e (diff) |
Merge 4.7-rc4 into staging-next
We want the fixes in here, and we can resolve a merge issue in
drivers/iio/industrialio-trigger.c
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-octeon.c')
-rw-r--r-- | drivers/i2c/busses/i2c-octeon.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/i2c/busses/i2c-octeon.c b/drivers/i2c/busses/i2c-octeon.c index aa5f01efd826..30ae35146723 100644 --- a/drivers/i2c/busses/i2c-octeon.c +++ b/drivers/i2c/busses/i2c-octeon.c | |||
@@ -934,8 +934,15 @@ static int octeon_i2c_read(struct octeon_i2c *i2c, int target, | |||
934 | return result; | 934 | return result; |
935 | 935 | ||
936 | for (i = 0; i < length; i++) { | 936 | for (i = 0; i < length; i++) { |
937 | /* for the last byte TWSI_CTL_AAK must not be set */ | 937 | /* |
938 | if (i + 1 == length) | 938 | * For the last byte to receive TWSI_CTL_AAK must not be set. |
939 | * | ||
940 | * A special case is I2C_M_RECV_LEN where we don't know the | ||
941 | * additional length yet. If recv_len is set we assume we're | ||
942 | * not reading the final byte and therefore need to set | ||
943 | * TWSI_CTL_AAK. | ||
944 | */ | ||
945 | if ((i + 1 == length) && !(recv_len && i == 0)) | ||
939 | final_read = true; | 946 | final_read = true; |
940 | 947 | ||
941 | /* clear iflg to allow next event */ | 948 | /* clear iflg to allow next event */ |
@@ -950,12 +957,8 @@ static int octeon_i2c_read(struct octeon_i2c *i2c, int target, | |||
950 | 957 | ||
951 | data[i] = octeon_i2c_data_read(i2c); | 958 | data[i] = octeon_i2c_data_read(i2c); |
952 | if (recv_len && i == 0) { | 959 | if (recv_len && i == 0) { |
953 | if (data[i] > I2C_SMBUS_BLOCK_MAX + 1) { | 960 | if (data[i] > I2C_SMBUS_BLOCK_MAX + 1) |
954 | dev_err(i2c->dev, | ||
955 | "%s: read len > I2C_SMBUS_BLOCK_MAX %d\n", | ||
956 | __func__, data[i]); | ||
957 | return -EPROTO; | 961 | return -EPROTO; |
958 | } | ||
959 | length += data[i]; | 962 | length += data[i]; |
960 | } | 963 | } |
961 | 964 | ||