Skip to content

Commit d1ef7a9

Browse files
Maxim LevitskyAndi Shyti
authored andcommitted
i2c: i801: Fix a refactoring that broke a touchpad on Lenovo P1
Commit 857cc04 ("i2c: i801: Add helper i801_get_block_len") introduced a slight functional change: the status variable is now overwritten with the length of an SMBUS tranasaction, even in case of success. This breaks the touchpad on at least my Lenovo P1: rmi4_physical rmi4-00: Read PDT entry at 0x00e9 failed, code: -6. rmi4_physical rmi4-00: RMI initial reset failed! Continuing in spite of this. rmi4_physical rmi4-00: Read PDT entry at 0x00e9 failed, code: -6. rmi4_physical rmi4-00: IRQ counting failed with code -6. Fixes: 857cc04 ("i2c: i801: Add helper i801_get_block_len") Signed-off-by: Maxim Levitsky <[email protected]> Reviewed-by: Heiner Kallweit <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
1 parent 4cece76 commit d1ef7a9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/i2c/busses/i2c-i801.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -536,11 +536,12 @@ static int i801_block_transaction_by_block(struct i801_priv *priv,
536536

537537
if (read_write == I2C_SMBUS_READ ||
538538
command == I2C_SMBUS_BLOCK_PROC_CALL) {
539-
status = i801_get_block_len(priv);
540-
if (status < 0)
539+
len = i801_get_block_len(priv);
540+
if (len < 0) {
541+
status = len;
541542
goto out;
543+
}
542544

543-
len = status;
544545
data->block[0] = len;
545546
inb_p(SMBHSTCNT(priv)); /* reset the data buffer index */
546547
for (i = 0; i < len; i++)

0 commit comments

Comments
 (0)