summaryrefslogtreecommitdiffstats
path: root/drivers/media/common/saa7146
diff options
context:
space:
mode:
authorPeter Rosin <peda@axentia.se>2019-01-09 06:24:56 -0500
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-01-16 12:38:42 -0500
commit8db63f3d14dc44c043afc00e5adeb541106ec16b (patch)
treef4fbe8ff227dc75c33e82e37f21c54bb777442e7 /drivers/media/common/saa7146
parent8809b8ceb0bd283c0528a0c7233656b12bcda2dc (diff)
downloadlinux-8db63f3d14dc44c043afc00e5adeb541106ec16b.tar.bz2
media: saa7146: make use of i2c_8bit_addr_from_msg
Because it looks neater. Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/common/saa7146')
-rw-r--r--drivers/media/common/saa7146/saa7146_i2c.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/media/common/saa7146/saa7146_i2c.c b/drivers/media/common/saa7146/saa7146_i2c.c
index 3feddc52c446..df9ebe2a168c 100644
--- a/drivers/media/common/saa7146/saa7146_i2c.c
+++ b/drivers/media/common/saa7146/saa7146_i2c.c
@@ -54,10 +54,7 @@ static int saa7146_i2c_msg_prepare(const struct i2c_msg *m, int num, __le32 *op)
/* loop through all messages */
for(i = 0; i < num; i++) {
- /* insert the address of the i2c-slave.
- note: we get 7 bit i2c-addresses,
- so we have to perform a translation */
- addr = (m[i].addr*2) + ( (0 != (m[i].flags & I2C_M_RD)) ? 1 : 0);
+ addr = i2c_8bit_addr_from_msg(&m[i]);
h1 = op_count/3; h2 = op_count%3;
op[h1] |= cpu_to_le32( (u8)addr << ((3-h2)*8));
op[h1] |= cpu_to_le32(SAA7146_I2C_START << ((3-h2)*2));