Skip to content

Commit

Permalink
[media] saa7706h: convert struct i2c_msg initialization to C99 format
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shubhrajyoti D authored and Mauro Carvalho Chehab committed Sep 27, 2012
1 parent 1215af4 commit c43737a
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions drivers/media/radio/saa7706h.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c43737a

Please sign in to comment.