i2c: qup: use address helper function in read transfer
authorNaveen Kaje <nkaje@codeaurora.org>
Thu, 5 May 2016 18:33:17 +0000 (12:33 -0600)
committerWolfram Sang <wsa@the-dreams.de>
Sat, 18 Jun 2016 16:26:58 +0000 (18:26 +0200)
qup_i2c_issue_read() derives the address from i2c_msg.
This called in the read path when I2C_M_RD flag is set.
Therefore, use the 8 bit address helper function.

Signed-off-by: Naveen Kaje <nkaje@codeaurora.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-qup.c

index 3e5fac88376d7c8ad153c53f12d00ef700398f7d..69849a95d479e584392216eb7a57d285f9f9c836 100644 (file)
@@ -1012,7 +1012,7 @@ static void qup_i2c_issue_read(struct qup_i2c_dev *qup, struct i2c_msg *msg)
 {
        u32 addr, len, val;
 
-       addr = (msg->addr << 1) | 1;
+       addr = i2c_8bit_addr_from_msg(msg);
 
        /* 0 is used to specify a length 256 (QUP_READ_LIMIT) */
        len = (msg->len == QUP_READ_LIMIT) ? 0 : msg->len;