HID: cp2112: fix I2C_SMBUS_BYTE write

When doing an I2C_SMBUS_BYTE write (one byte write, no address),
the data to be written is in "command" not "data->byte".

Signed-off-by: Ellen Wang <[email protected]>
Acked-by: Wolfram Sang <[email protected]>
Reviewed-by: Antonio Borneo <[email protected]>
Cc: [email protected]
Signed-off-by: Jiri Kosina <[email protected]>
This commit is contained in:
Ellen Wang 2015-07-13 15:23:54 -07:00 • committed by Jiri Kosina
commit 6d00d153f0

View file

@ -606,7 +606,7 @@ static int cp2112_xfer(struct i2c_adapter *adap, u16 addr,
if (I2C_SMBUS_READ == read_write)
count = cp2112_read_req(buf, addr, read_length);
else
count = cp2112_write_req(buf, addr, data->byte, NULL,
count = cp2112_write_req(buf, addr, command, NULL,
0);
break;
case I2C_SMBUS_BYTE_DATA: