diff options
author | Shubhrajyoti D <shubhrajyoti@ti.com> | 2012-10-05 16:23:52 -0400 |
---|---|---|
committer | Jean Delvare <khali@endymion.delvare> | 2012-10-05 16:23:52 -0400 |
commit | 230da094352869ac36bca524a294deb7bb3dd876 (patch) | |
tree | 44b8c3244f69d52ecff88083ce451aadde80938d /drivers/i2c | |
parent | 71b578452ec6b2e8a470e3dae89055cd1068a9f0 (diff) |
i2c: 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.
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/i2c-core.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 2421d95130d4..a7edf987a339 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
@@ -1989,12 +1989,22 @@ static s32 i2c_smbus_xfer_emulated(struct i2c_adapter *adapter, u16 addr, | |||
1989 | unsigned char msgbuf0[I2C_SMBUS_BLOCK_MAX+3]; | 1989 | unsigned char msgbuf0[I2C_SMBUS_BLOCK_MAX+3]; |
1990 | unsigned char msgbuf1[I2C_SMBUS_BLOCK_MAX+2]; | 1990 | unsigned char msgbuf1[I2C_SMBUS_BLOCK_MAX+2]; |
1991 | int num = read_write == I2C_SMBUS_READ ? 2 : 1; | 1991 | int num = read_write == I2C_SMBUS_READ ? 2 : 1; |
1992 | struct i2c_msg msg[2] = { { addr, flags, 1, msgbuf0 }, | ||
1993 | { addr, flags | I2C_M_RD, 0, msgbuf1 } | ||
1994 | }; | ||
1995 | int i; | 1992 | int i; |
1996 | u8 partial_pec = 0; | 1993 | u8 partial_pec = 0; |
1997 | int status; | 1994 | int status; |
1995 | struct i2c_msg msg[2] = { | ||
1996 | { | ||
1997 | .addr = addr, | ||
1998 | .flags = flags, | ||
1999 | .len = 1, | ||
2000 | .buf = msgbuf0, | ||
2001 | }, { | ||
2002 | .addr = addr, | ||
2003 | .flags = flags | I2C_M_RD, | ||
2004 | .len = 0, | ||
2005 | .buf = msgbuf1, | ||
2006 | }, | ||
2007 | }; | ||
1998 | 2008 | ||
1999 | msgbuf0[0] = command; | 2009 | msgbuf0[0] = command; |
2000 | switch (size) { | 2010 | switch (size) { |