i2c: bcm-kona: use new 8 bit address helper function
authorWolfram Sang <wsa@the-dreams.de>
Sun, 3 Apr 2016 18:44:48 +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/busses/i2c-bcm-kona.c

index 2c9d9b1c8e6441d6b7ab988f72765c982ee0deaa..ac9f47679c3a4b18eabfb48c76420ca5871cc34d 100644 (file)
@@ -501,10 +501,7 @@ static int bcm_kona_i2c_do_addr(struct bcm_kona_i2c_dev *dev,
                                return -EREMOTEIO;
                }
        } else {
-               addr = msg->addr << 1;
-
-               if (msg->flags & I2C_M_RD)
-                       addr |= 1;
+               addr = i2c_8bit_addr_from_msg(msg);
 
                if (bcm_kona_i2c_write_byte(dev, addr, 0) < 0)
                        return -EREMOTEIO;