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

index 7d2bd3ec2d2d252e97ccdc064c6289f6ededc522..6fb3e2645992297937635c0ffd0f791ed5c92b1e 100644 (file)
@@ -398,8 +398,7 @@ static void sh_mobile_i2c_get_data(struct sh_mobile_i2c_data *pd,
 {
        switch (pd->pos) {
        case -1:
-               *buf = (pd->msg->addr & 0x7f) << 1;
-               *buf |= (pd->msg->flags & I2C_M_RD) ? 1 : 0;
+               *buf = i2c_8bit_addr_from_msg(pd->msg);
                break;
        default:
                *buf = pd->msg->buf[pd->pos];