From: Ellen Wang Date: Mon, 13 Jul 2015 22:23:54 +0000 (-0700) Subject: HID: cp2112: fix I2C_SMBUS_BYTE write X-Git-Tag: v4.1.8~28 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=fd54f2ee1ac27477ebf78d082e6e411d82fe3766;p=users%2Fjedix%2Flinux-maple.git HID: cp2112: fix I2C_SMBUS_BYTE write commit 6d00d153f00097d259f86304e11858a50a1b8ad1 upstream. 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 Acked-by: Wolfram Sang Reviewed-by: Antonio Borneo Signed-off-by: Jiri Kosina Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/hid/hid-cp2112.c b/drivers/hid/hid-cp2112.c index 45198baf3523b..39bf74793b8b0 100644 --- a/drivers/hid/hid-cp2112.c +++ b/drivers/hid/hid-cp2112.c @@ -554,7 +554,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: