summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEllen Wang <ellen@cumulusnetworks.com>2015-07-13 22:23:54 (GMT)
committerJiri Kosina <jkosina@suse.com>2015-07-14 12:49:53 (GMT)
commit6d00d153f00097d259f86304e11858a50a1b8ad1 (patch)
treeaf12f510dfd97fc6f04412ee0831b453c58b3a1c
parent44eda784a2229d25e2724ef1734fe67453716231 (diff)
downloadlinux-6d00d153f00097d259f86304e11858a50a1b8ad1.tar.xz
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 <ellen@cumulusnetworks.com> Acked-by: Wolfram Sang <wsa@the-dreams.de> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Jiri Kosina <jkosina@suse.com>
-rw-r--r--drivers/hid/hid-cp2112.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/hid-cp2112.c b/drivers/hid/hid-cp2112.c
index 1d24a65..a84d370 100644
--- a/drivers/hid/hid-cp2112.c
+++ b/drivers/hid/hid-cp2112.c
@@ -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: