]> Pileus Git - ~andy/linux/commitdiff
[media] saa7706h: convert struct i2c_msg initialization to C99 format
authorShubhrajyoti D <shubhrajyoti@ti.com>
Tue, 18 Sep 2012 11:22:35 +0000 (08:22 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 27 Sep 2012 10:40:10 +0000 (07:40 -0300)
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>
drivers/media/radio/saa7706h.c

index bb953ef75f615dd831ecca6204f9aad36bc18a12..54db36ccb9ee2bb23d3e9615fe7c5b8a7e0967ef 100644 (file)
@@ -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)