From patchwork Wed Oct 10 11:35:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhrajyoti Datta X-Patchwork-Id: 1573001 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id AF2C5DFB34 for ; Wed, 10 Oct 2012 11:35:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751573Ab2JJLfl (ORCPT ); Wed, 10 Oct 2012 07:35:41 -0400 Received: from mail-ia0-f174.google.com ([209.85.210.174]:53550 "EHLO mail-ia0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751144Ab2JJLfk (ORCPT ); Wed, 10 Oct 2012 07:35:40 -0400 Received: by mail-ia0-f174.google.com with SMTP id y32so259562iag.19 for ; Wed, 10 Oct 2012 04:35:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=mz//vRfmnYwVdxqyZcjB63FQQjvowPmTJF4KYJjxyZY=; b=anvoT7Bg/K9h8/Q+AOblqTBI1+NgBMQ9oqj2VEFjY41ShqQ8IadF+vfbIC1HoirQWR igEd2Cc218wKT+UHm3cW52KWUCsOPXGCeuJJ0rq/ogBhl3Fy/1/odbdMkrLJekyGYFhz v6depbElcqeaF1SpWbEb1Vyd8a0pAd6U4TnUzhFPpVK8miWbiTuw98rsZ9s9KF4xMZYZ SyNjR1b5fkXVy4IS/tZDAj3TRnUwa7Mbzxy783ZvNIGr2tV7D9d+EXu9XxLUwj1nPEG7 dO358vqXipNvaB0DzSKVk26mc46ZucXk6ZYHDmBB+iVbofCylZ37+3prCVSxDvusVt1d y5LQ== MIME-Version: 1.0 Received: by 10.50.37.168 with SMTP id z8mr4982084igj.1.1349868939483; Wed, 10 Oct 2012 04:35:39 -0700 (PDT) Received: by 10.42.228.10 with HTTP; Wed, 10 Oct 2012 04:35:39 -0700 (PDT) In-Reply-To: <20121010110228.3cbccde3@endymion.delvare> References: <1349782278-9023-1-git-send-email-shubhrajyoti@ti.com> <1349782278-9023-2-git-send-email-shubhrajyoti@ti.com> <20121010110228.3cbccde3@endymion.delvare> Date: Wed, 10 Oct 2012 17:05:39 +0530 Message-ID: Subject: Re: [PATCH 2/4] input: Convert struct i2c_msg initialization to C99 format From: Shubhrajyoti Datta To: Jean Delvare Cc: Shubhrajyoti D , linux-input@vger.kernel.org, linux-i2c@vger.kernel.org, dmitry.torokhov@gmail.com Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org On Wed, Oct 10, 2012 at 2:32 PM, Jean Delvare wrote: > On Tue, 9 Oct 2012 17:01:18 +0530, Shubhrajyoti D wrote: [...] > > Acked-by: Jean Delvare thanks updated patch below From 6638ecfa7982f95815382922c50573712c9626d7 Mon Sep 17 00:00:00 2001 From: Shubhrajyoti D Date: Mon, 17 Sep 2012 19:37:17 +0530 Subject: [PATCHv2 1/2] input: 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. Thanks to Julia Lawall for automating the conversion Acked-by: Jean Delvare Signed-off-by: Shubhrajyoti D --- drivers/input/touchscreen/cy8ctmg110_ts.c | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/cy8ctmg110_ts.c b/drivers/input/touchscreen/cy8ctmg110_ts.c index 464f1bf..ad6a664 100644 --- a/drivers/input/touchscreen/cy8ctmg110_ts.c +++ b/drivers/input/touchscreen/cy8ctmg110_ts.c @@ -99,9 +99,18 @@ static int cy8ctmg110_read_regs(struct cy8ctmg110 *tsc, int ret; struct i2c_msg msg[2] = { /* first write slave position to i2c devices */ - { client->addr, 0, 1, &cmd }, + { + .addr = client->addr, + .len = 1, + .buf = &cmd + }, /* Second read data from position */ - { client->addr, I2C_M_RD, len, data } + { + .addr = client->addr, + .flags = I2C_M_RD, + .len = len, + .buf = data + } }; ret = i2c_transfer(client->adapter, msg, 2);