mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 00:34:20 +08:00
[media] saa7706h: convert struct i2c_msg initialization to C99 format
Convert the struct i2c_msg initialization to C99 format. This makes maintaining and editing the code simpler. Also helps once other fields like transferred are added in future. Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
1215af4836
commit
c43737aac9
@ -199,8 +199,19 @@ static int saa7706h_get_reg16(struct v4l2_subdev *sd, u16 reg)
|
||||
u8 buf[2];
|
||||
int err;
|
||||
u8 regaddr[] = {reg >> 8, reg};
|
||||
struct i2c_msg msg[] = { {client->addr, 0, sizeof(regaddr), regaddr},
|
||||
{client->addr, I2C_M_RD, sizeof(buf), buf} };
|
||||
struct i2c_msg msg[] = {
|
||||
{
|
||||
.addr = client->addr,
|
||||
.len = sizeof(regaddr),
|
||||
.buf = regaddr
|
||||
},
|
||||
{
|
||||
.addr = client->addr,
|
||||
.flags = I2C_M_RD,
|
||||
.len = sizeof(buf),
|
||||
.buf = buf
|
||||
}
|
||||
};
|
||||
|
||||
err = saa7706h_i2c_transfer(client, msg, ARRAY_SIZE(msg));
|
||||
if (err)
|
||||
|
Loading…
Reference in New Issue
Block a user