From: Mauro Carvalho Chehab <mchehab@redhat.com>
Date: Mon, 5 Nov 2007 14:03:04 +0000 (-0300)
Subject: V4L/DVB (12813): tm6000: all read messages should use prev_reg
X-Git-Tag: firefly_0821_release~9833^2~2094^2~493
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=28cb88caaec4d22c970a28e080c1815ee3b043fa;p=firefly-linux-kernel-4.4.55.git

V4L/DVB (12813): tm6000: all read messages should use prev_reg

read messages with length>1 where using the wrong register.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---

diff --git a/drivers/staging/tm6000/tm6000-i2c.c b/drivers/staging/tm6000/tm6000-i2c.c
index 10c7d947d53e..c53b7046c2ec 100644
--- a/drivers/staging/tm6000/tm6000-i2c.c
+++ b/drivers/staging/tm6000/tm6000-i2c.c
@@ -113,21 +113,11 @@ static int tm6000_i2c_xfer(struct i2c_adapter *i2c_adap,
 	   out of message data.
 	 */
 			/* SMBus Read Byte command */
-			if(msgs[i].len == 1) {
-				// we use the previously used register to read from
-				rc = tm6000_read_write_usb (dev,
-					USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-					REQ_16_SET_GET_I2CSEQ,
-					addr | prev_reg<<8, 0,
-					msgs[i].buf, msgs[i].len);
-			}
-			else {
-				rc = tm6000_read_write_usb (dev,
-					USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-					REQ_16_SET_GET_I2CSEQ,
-					addr|(*msgs[i].buf)<<8, 0,
-					msgs[i].buf, msgs[i].len);
-			}
+			rc = tm6000_read_write_usb (dev,
+				USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+				REQ_16_SET_GET_I2CSEQ,
+				addr | (prev_reg << 8), 0,
+				msgs[i].buf, msgs[i].len);
 			if (i2c_debug>=2) {
 				for (byte = 0; byte < msgs[i].len; byte++) {
 					printk(" %02x", msgs[i].buf[byte]);