HID: cp2112: fix I2C_SMBUS_BYTE write
authorEllen Wang <ellen@cumulusnetworks.com>
Mon, 13 Jul 2015 22:23:54 +0000 (15:23 -0700)
committerJiri Kosina <jkosina@suse.com>
Tue, 14 Jul 2015 12:49:53 +0000 (14:49 +0200)
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>
drivers/hid/hid-cp2112.c

index 1d24a65b42952e5d71f3f00eaf610769aceb7a8c..a84d3700e740e430fd3407d3e1f37c27bb166945 100644 (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:
This page took 0.025866 seconds and 5 git commands to generate.