]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[media] ks0127: convert struct i2c_msg initialization to C99 format
authorShubhrajyoti D <shubhrajyoti@ti.com>
Tue, 18 Sep 2012 11:22:31 +0000 (08:22 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 27 Sep 2012 10:38:40 +0000 (07:38 -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/i2c/ks0127.c

index ee7ca2dcca2fd3cf8d38502b618b25be1b50d4b0..04a6efa37cc376eb2c49637b26a499da8665439b 100644 (file)
@@ -319,8 +319,17 @@ static u8 ks0127_read(struct v4l2_subdev *sd, u8 reg)
        struct i2c_client *client = v4l2_get_subdevdata(sd);
        char val = 0;
        struct i2c_msg msgs[] = {
-               { client->addr, 0, sizeof(reg), &reg },
-               { client->addr, I2C_M_RD | I2C_M_NO_RD_ACK, sizeof(val), &val }
+               {
+                       .addr = client->addr,
+                       .len = sizeof(reg),
+                       .buf = &reg
+               },
+               {
+                       .addr = client->addr,
+                       .flags = I2C_M_RD | I2C_M_NO_RD_ACK,
+                       .len = sizeof(val),
+                       .buf = &val
+               }
        };
        int ret;