mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jan Luebbe <jluebbe@debian.org>
To: barebox@lists.infradead.org
Subject: [PATCH v2 4/6] i2c: algo-bit: fix debug code
Date: Thu, 30 Jul 2015 16:52:09 +0200	[thread overview]
Message-ID: <1438267931-22374-5-git-send-email-jluebbe@debian.org> (raw)
In-Reply-To: <1438267931-22374-1-git-send-email-jluebbe@debian.org>

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@debian.org>
---
 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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2015-07-30 14:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-30 14:52 [PATCH v2 0/6] i2c: add bus recovery infrastructure Jan Luebbe
2015-07-30 14:52 ` [PATCH v2 1/6] " Jan Luebbe
2015-07-30 14:52 ` [PATCH v2 2/6] i2c-omap: clear ARDY twice Jan Luebbe
2015-07-30 14:52 ` [PATCH v2 3/6] i2c-omap: add bus recovery support Jan Luebbe
2015-07-30 14:52 ` Jan Luebbe [this message]
2015-07-30 14:52 ` [PATCH v2 5/6] i2c: algo-bit: check if the bus is busy Jan Luebbe
2015-07-30 14:52 ` [PATCH v2 6/6] i2c: gpio: add bus recovery support Jan Luebbe
2015-07-31  7:29 ` [PATCH v2 0/6] i2c: add bus recovery infrastructure Sascha Hauer
2015-08-03  9:20   ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1438267931-22374-5-git-send-email-jluebbe@debian.org \
    --to=jluebbe@debian.org \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox