patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / drivers / i2c / algos / i2c-algo-bit.c
index efcb775..afbd48f 100644 (file)
@@ -381,7 +381,13 @@ static inline int readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
                        break;
                }
 
-               if ( count > 1 ) {              /* send ack */
+               temp++;
+               count--;
+
+               if (msg->flags & I2C_M_NO_RD_ACK)
+                       continue;
+
+               if ( count > 0 ) {              /* send ack */
                        sdalo(adap);
                        DEBPROTO(printk(" Am "));
                } else {
@@ -395,8 +401,6 @@ static inline int readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
                };
                scllo(adap);
                sdahi(adap);
-               temp++;
-               count--;
        }
        return rdcount;
 }