[PATCH v2 4/6] i2c: algo-bit: fix debug code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Replace jiffies from kernel code with get_time_ns. The flags variable
used in the readbytes debug output does not exist.

Signed-off-by: Jan Luebbe <jluebbe@xxxxxxxxxx>
---
 drivers/i2c/algos/i2c-algo-bit.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c
index dc43eb8..62040cc 100644
--- a/drivers/i2c/algos/i2c-algo-bit.c
+++ b/drivers/i2c/algos/i2c-algo-bit.c
@@ -106,9 +106,10 @@ static int sclhi(struct i2c_algo_bit_data *adap)
 		}
 	}
 #ifdef DEBUG
-	if (jiffies != start && i2c_debug >= 3)
-		pr_debug("i2c-algo-bit: needed %ld jiffies for SCL to go "
-			 "high\n", jiffies - start);
+	if ((get_time_ns() - start) < 10000)
+		pr_debug("i2c-algo-bit: needed %u usecs for SCL to go "
+			 "high\n", (unsigned int)(get_time_ns() - start) /
+			 1000);
 #endif
 
 done:
@@ -426,10 +427,7 @@ static int readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
 		count--;
 
 		bit_dbg(2, &i2c_adap->dev, "readbytes: 0x%02x %s\n",
-			inval,
-			(flags & I2C_M_NO_RD_ACK)
-				? "(no ack/nak)"
-				: (count ? "A" : "NA"));
+			inval, count ? "A" : "NA");
 
 		inval = acknak(i2c_adap, count);
 		if (inval < 0)
-- 
2.1.4


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux