diff mbox

dibusb-common.c FE_HAS_LOCK problem

Message ID 20091107105614.7a51f2f5@x2.grafnetz (mailing list archive)
State Superseded
Headers show

Commit Message

Mario Bachmann Nov. 7, 2009, 9:56 a.m. UTC
None
diff mbox

Patch

diff -Naur dibusb-common.c-ORIGINAL dibusb-common.c

--- dibusb-common.c-ORIGINAL	2009-11-07 10:30:43.705344308 +0100
+++ dibusb-common.c	2009-11-07 10:33:49.969345253 +0100
@@ -133,17 +133,14 @@ 
 
 	for (i = 0; i < num; i++) {
 		/* write/read request */
-		if (i+1 < num && (msg[i].flags & I2C_M_RD) == 0
-					  && (msg[i+1].flags & I2C_M_RD)) {
+		if (i+1 < num && (msg[i+1].flags & I2C_M_RD)) {
 			if (dibusb_i2c_msg(d, msg[i].addr, msg[i].buf,msg[i].len,
 						msg[i+1].buf,msg[i+1].len) < 0)
 				break;
 			i++;
-		} else if ((msg[i].flags & I2C_M_RD) == 0) {
+		} else
 			if (dibusb_i2c_msg(d, msg[i].addr, msg[i].buf,msg[i].len,NULL,0) < 0)
 				break;
-		} else
-			break;
 	}
 
 	mutex_unlock(&d->i2c_mutex);