Skip to content

Commit

Permalink
Input: cy8ctmg110_ts - use C99-style structure initializators
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.

Thanks to Julia Lawall <julia.lawall@lip6.fr>  for automating the
conversion.

Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Shubhrajyoti Datta authored and Dmitry Torokhov committed Oct 11, 2012
1 parent 7f8d4ca commit 9493d97
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions drivers/input/touchscreen/cy8ctmg110_ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9493d97

Please sign in to comment.