diff mbox

[15/18] i2c: i2c-qup: use new 8 bit address helper function

Message ID 1459709101-24462-16-git-send-email-wsa@the-dreams.de
State Accepted
Headers show

Commit Message

Wolfram Sang April 3, 2016, 6:44 p.m. UTC
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
 drivers/i2c/busses/i2c-qup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Naveen Kaje May 5, 2016, 6:27 p.m. UTC | #1
On 4/3/2016 12:44 PM, Wolfram Sang wrote:
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
> ---
>   drivers/i2c/busses/i2c-qup.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c
> index 23eaabb19f961a..cc6439ab3f7141 100644
> --- a/drivers/i2c/busses/i2c-qup.c
> +++ b/drivers/i2c/busses/i2c-qup.c
> @@ -515,7 +515,7 @@ static int qup_i2c_get_data_len(struct qup_i2c_dev *qup)
>   static int qup_i2c_set_tags(u8 *tags, struct qup_i2c_dev *qup,
>   			    struct i2c_msg *msg,  int is_dma)
>   {
> -	u16 addr = (msg->addr << 1) | ((msg->flags & I2C_M_RD) == I2C_M_RD);
> +	u16 addr = i2c_8bit_addr_from_msg(msg);
>   	int len = 0;
>   	int data_len;
Looks good to me. Tested ok on QDF2432.
There is another place in issue_read that we can use this helper 
function. I will send a follow up patch.

Reviewed by: Naveen Kaje <nkaje@codeaurora.org>
Tested by: Naveen Kaje <nkaje@codeaurora.org>
>   

--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c
index 23eaabb19f961a..cc6439ab3f7141 100644
--- a/drivers/i2c/busses/i2c-qup.c
+++ b/drivers/i2c/busses/i2c-qup.c
@@ -515,7 +515,7 @@  static int qup_i2c_get_data_len(struct qup_i2c_dev *qup)
 static int qup_i2c_set_tags(u8 *tags, struct qup_i2c_dev *qup,
 			    struct i2c_msg *msg,  int is_dma)
 {
-	u16 addr = (msg->addr << 1) | ((msg->flags & I2C_M_RD) == I2C_M_RD);
+	u16 addr = i2c_8bit_addr_from_msg(msg);
 	int len = 0;
 	int data_len;