aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/algos/i2c-algo-pcf.c
diff options
context:
space:
mode:
authorPeter Rosin <peda@axentia.se>2018-05-16 09:16:46 +0200
committerWolfram Sang <wsa@the-dreams.de>2018-05-29 20:30:06 +0200
commitac6d5298f6af763b587495d62041fe57a2fb89e6 (patch)
treeb3b8e1606dc0f5cfc1e9c241cf4ca14eb0b541b4 /drivers/i2c/algos/i2c-algo-pcf.c
parenti2c: rcar: document R8A77980 bindings (diff)
downloadlinux-dev-ac6d5298f6af763b587495d62041fe57a2fb89e6.tar.xz
linux-dev-ac6d5298f6af763b587495d62041fe57a2fb89e6.zip
i2c: algos: make use of i2c_8bit_addr_from_msg
Because it looks neater. Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/algos/i2c-algo-pcf.c')
-rw-r--r--drivers/i2c/algos/i2c-algo-pcf.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/i2c/algos/i2c-algo-pcf.c b/drivers/i2c/algos/i2c-algo-pcf.c
index 270d84bfc2c6..5c29a4d397cf 100644
--- a/drivers/i2c/algos/i2c-algo-pcf.c
+++ b/drivers/i2c/algos/i2c-algo-pcf.c
@@ -291,13 +291,9 @@ static int pcf_readbytes(struct i2c_adapter *i2c_adap, char *buf,
static int pcf_doAddress(struct i2c_algo_pcf_data *adap,
struct i2c_msg *msg)
{
- unsigned short flags = msg->flags;
- unsigned char addr;
+ unsigned char addr = i2c_8bit_addr_from_msg(msg);
- addr = msg->addr << 1;
- if (flags & I2C_M_RD)
- addr |= 1;
- if (flags & I2C_M_REV_DIR_ADDR)
+ if (msg->flags & I2C_M_REV_DIR_ADDR)
addr ^= 1;
i2c_outb(adap, addr);