i2c: core: use new 8 bit address helper function
authorWolfram Sang <wsa@the-dreams.de>
Sun, 3 Apr 2016 18:44:46 +0000 (20:44 +0200)
committerWolfram Sang <wsa@the-dreams.de>
Mon, 11 Apr 2016 16:54:59 +0000 (18:54 +0200)
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/i2c-core.c

index e584d88ee337f66e158644076f7b9a2b0018177e..cc3c143b1c6a50c254be845051c91de7ef16283b 100644 (file)
@@ -2646,7 +2646,7 @@ static u8 i2c_smbus_pec(u8 crc, u8 *p, size_t count)
 static u8 i2c_smbus_msg_pec(u8 pec, struct i2c_msg *msg)
 {
        /* The address will be sent first */
-       u8 addr = (msg->addr << 1) | !!(msg->flags & I2C_M_RD);
+       u8 addr = i2c_8bit_addr_from_msg(msg);
        pec = i2c_smbus_pec(pec, &addr, 1);
 
        /* The data buffer follows */