From ac6d5298f6af763b587495d62041fe57a2fb89e6 Mon Sep 17 00:00:00 2001 From: Peter Rosin Date: Wed, 16 May 2018 09:16:46 +0200 Subject: i2c: algos: make use of i2c_8bit_addr_from_msg Because it looks neater. Signed-off-by: Peter Rosin Signed-off-by: Wolfram Sang --- drivers/i2c/algos/i2c-algo-pca.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'drivers/i2c/algos/i2c-algo-pca.c') diff --git a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c index e370804ec8bc..883a290f6a4d 100644 --- a/drivers/i2c/algos/i2c-algo-pca.c +++ b/drivers/i2c/algos/i2c-algo-pca.c @@ -112,11 +112,8 @@ static int pca_address(struct i2c_algo_pca_data *adap, struct i2c_msg *msg) { int sta = pca_get_con(adap); - int addr; + int addr = i2c_8bit_addr_from_msg(msg); - addr = ((0x7f & msg->addr) << 1); - if (msg->flags & I2C_M_RD) - addr |= 1; DEB2("=== SLAVE ADDRESS %#04x+%c=%#04x\n", msg->addr, msg->flags & I2C_M_RD ? 'R' : 'W', addr); -- cgit v1.2.3