mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shubhrajyoti D <shubhrajyoti@ti.com>
To: <linux-media@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <julia.lawall@lip6.fr>,
	Shubhrajyoti D <shubhrajyoti@ti.com>
Subject: [PATCHv3 1/6] media: Convert struct i2c_msg initialization to C99 format
Date: Tue, 18 Sep 2012 17:14:27 +0530	[thread overview]
Message-ID: <1347968672-10803-2-git-send-email-shubhrajyoti@ti.com> (raw)
In-Reply-To: <1347968672-10803-1-git-send-email-shubhrajyoti@ti.com>

        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>
---
 drivers/media/i2c/ks0127.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/ks0127.c b/drivers/media/i2c/ks0127.c
index ee7ca2d..04a6efa 100644
--- a/drivers/media/i2c/ks0127.c
+++ b/drivers/media/i2c/ks0127.c
@@ -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;
 
-- 
1.7.5.4


  reply	other threads:[~2012-09-18 11:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-18 11:44 [PATCHv3 0/6] media: convert to c99 format Shubhrajyoti D
2012-09-18 11:44 ` Shubhrajyoti D [this message]
2012-09-18 11:44 ` [PATCHv3 2/6] media: Convert struct i2c_msg initialization to C99 format Shubhrajyoti D
2012-09-18 11:44 ` [PATCHv3 3/6] " Shubhrajyoti D
2012-09-18 11:44 ` [PATCHv3 4/6] " Shubhrajyoti D
2012-09-18 11:44 ` [PATCHv3 5/6] " Shubhrajyoti D
2012-09-18 11:42   ` Felipe Balbi
2012-09-18 12:19     ` Shubhrajyoti
2012-09-18 11:44 ` [PATCHv3 6/6] " Shubhrajyoti D
2012-09-25 11:03 ` [PATCHv3 0/6] media: convert to c99 format Ezequiel Garcia
2012-09-25 11:09   ` Mauro Carvalho Chehab
2012-09-25 11:13     ` Ezequiel Garcia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1347968672-10803-2-git-send-email-shubhrajyoti@ti.com \
    --to=shubhrajyoti@ti.com \
    --cc=julia.lawall@lip6.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®