summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-mlxcpld.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-07-05 10:35:01 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2020-07-05 10:35:01 -0700
commit7783485401e802b4802c93cb1b23deb7f0d168a4 (patch)
treeb841bb4488efc3b4e2e11a578f5d073b5d0eda44 /drivers/i2c/busses/i2c-mlxcpld.c
parent45a5ac7a5cc3c71739d240c422c3818a5bc97fc4 (diff)
parent597911287fcd13c3a4b4aa3e0a52b33d431e0a8e (diff)
downloadlinux-7783485401e802b4802c93cb1b23deb7f0d168a4.tar.bz2
Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c fixes from Wolfram Sang: "The usual driver fixes and documentation updates" * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: mlxcpld: check correct size of maximum RECV_LEN packet i2c: add Kconfig help text for slave mode i2c: slave-eeprom: update documentation i2c: eg20t: Load module automatically if ID matches i2c: designware: platdrv: Set class based on DMI i2c: algo-pca: Add 0x78 as SCL stuck low status for PCA9665
Diffstat (limited to 'drivers/i2c/busses/i2c-mlxcpld.c')
-rw-r--r--drivers/i2c/busses/i2c-mlxcpld.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-mlxcpld.c b/drivers/i2c/busses/i2c-mlxcpld.c
index 2fd717d8dd30..71d7bae2cbca 100644
--- a/drivers/i2c/busses/i2c-mlxcpld.c
+++ b/drivers/i2c/busses/i2c-mlxcpld.c
@@ -337,9 +337,9 @@ static int mlxcpld_i2c_wait_for_tc(struct mlxcpld_i2c_priv *priv)
if (priv->smbus_block && (val & MLXCPLD_I2C_SMBUS_BLK_BIT)) {
mlxcpld_i2c_read_comm(priv, MLXCPLD_LPCI2C_NUM_DAT_REG,
&datalen, 1);
- if (unlikely(datalen > (I2C_SMBUS_BLOCK_MAX + 1))) {
+ if (unlikely(datalen > I2C_SMBUS_BLOCK_MAX)) {
dev_err(priv->dev, "Incorrect smbus block read message len\n");
- return -E2BIG;
+ return -EPROTO;
}
} else {
datalen = priv->xfer.data_len;