Received: from milmhbs1.lsil.com (147.145.21.209) by coscas01.lsi.com
 (172.21.36.60) with Microsoft SMTP Server id 8.1.393.1; Mon, 16 Nov 2009
 04:42:01 -0700
Received: from mail2.lsil.com (mail2.lsil.com [147.145.40.22])	by
 milmhbs1.lsil.com (8.12.11/8.12.11) with ESMTP id nAGBfiYq018177	for
 <andy.sharp@lsi.com>; Mon, 16 Nov 2009 03:41:46 -0800
Received: from psmtp.com (na3sys009amx184.postini.com [74.125.149.165])	by
 mail2.lsil.com (8.12.11/8.12.11) with SMTP id nAGBbPb1029210	for
 <andy.sharp@lsi.com>; Mon, 16 Nov 2009 03:37:44 -0800 (PST)
Received: from source ([78.24.191.182]) by na3sys009amx184.postini.com
 ([74.125.148.14]) with SMTP;	Mon, 16 Nov 2009 05:41:42 CST
Received: from localhost.localdomain ([127.0.0.1]:60197 "EHLO
	eddie.linux-mips.org" rhost-flags-OK-OK-OK-FAIL) by ftp.linux-mips.org	with
 ESMTP id S1492817AbZKPLk7 (ORCPT <rfc822;andy.sharp@lsi.com>);	Mon, 16 Nov
 2009 12:40:59 +0100
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 16 Nov 2009 12:40:42
 +0100 (CET)
Received: from TYO202.gate.nec.co.jp ([202.32.8.206]:45148 "EHLO
	tyo202.gate.nec.co.jp" rhost-flags-OK-OK-OK-OK) by ftp.linux-mips.org	with
 ESMTP id S1492803AbZKPLkf (ORCPT	<rfc822;linux-mips@linux-mips.org>); Mon, 16
 Nov 2009 12:40:35 +0100
Received: from relay11.aps.necel.com ([10.29.19.46])	by tyo202.gate.nec.co.jp
 (8.13.8/8.13.4) with ESMTP id nAGBeEMl018401;	Mon, 16 Nov 2009 20:40:14 +0900
 (JST)
Received: from realmbox31.aps.necel.com ([10.29.19.28] [10.29.19.28]) by
 relay11.aps.necel.com with ESMTP; Mon, 16 Nov 2009 20:40:14 +0900
Received: from [10.114.181.128] ([10.114.181.128] [10.114.181.128]) by
 mbox02.aps.necel.com with ESMTP; Mon, 16 Nov 2009 20:40:14 +0900
From: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
To: "baruch@tkos.co.il" <baruch@tkos.co.il>, "ben-linux@fluff.org"
	<ben-linux@fluff.org>, "linux-i2c@vger.kernel.org"
	<linux-i2c@vger.kernel.org>
CC: "linux-mips@linux-mips.org" <linux-mips@linux-mips.org>,
	"linux-arm-kernel@lists.infradead.org" <linux-arm-kernel@lists.infradead.org>
Sender: "linux-mips-bounce@linux-mips.org" <linux-mips-bounce@linux-mips.org>
Date: Mon, 16 Nov 2009 04:40:14 -0700
Subject: [PATCH 23/22] i2c-designware: i2c_dw_handle_tx_abort: Use dev_dbg()
 for NOACK cases
Thread-Topic: [PATCH 23/22] i2c-designware: i2c_dw_handle_tx_abort: Use
 dev_dbg() for NOACK cases
Thread-Index: AcpmsdAccdOfgZGrTVWMPDGZ1VZ8UA==
Message-ID: <4B013A1E.2050206@necel.com>
References: <4AF419B6.1000802@necel.com>
In-Reply-To: <4AF419B6.1000802@necel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Exchange-Organization-AuthAs: Anonymous
X-MS-Exchange-Organization-AuthSource: coscas01.lsi.com
X-MS-Has-Attach:
X-Auto-Response-Suppress: All
X-MS-TNEF-Correlator:
x-scanned-by: MIMEDefang 2.39
errors-to: linux-mips-bounce@linux-mips.org
x-pstn-levels: (S:99.90000/99.90000 CV:99.9000 FC:95.5390 LC:93.6803
 R:95.9108 P:95.9108 M:97.0282 C:98.6951 )
x-pstn-settings: 3 (1.0000:1.0000) s cv gt3 gt2 gt1 r p m c 
x-pstn-addresses: from <shinya.kuribayashi@necel.com> [22/1] 
x-pstn-neptune: 1/1/1.00/75
user-agent: Thunderbird 2.0.0.23 (Windows/20090812)
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

In the case of no-ACKs, we don't want to see dev_err() messages in the
console, because some utilities like i2c-tools are capable of printing
decorated console output.  This patch will ease such situations.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
---

Hi Ben,

 This patch can be applied on the top of the v2 patchset (as 23/22).
 I've tested the patch with both no-ACK cases and arbitration case.
 As for errors other than NOACKs, it's worth doing dev_err().

 drivers/i2c/busses/i2c-designware.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-designware.c b/drivers/i2c/busses/i2c-d=
esignware.c
index 4534d45..9e18ef9 100644
--- a/drivers/i2c/busses/i2c-designware.c
+++ b/drivers/i2c/busses/i2c-designware.c
@@ -496,13 +496,18 @@ static int i2c_dw_handle_tx_abort(struct dw_i2c_dev *=
dev)
 	unsigned long abort_source =3D dev->abort_source;
 	int i;
=20
+	if (abort_source & DW_IC_TX_ABRT_NOACK) {
+		for_each_bit(i, &abort_source, ARRAY_SIZE(abort_sources))
+			dev_dbg(dev->dev,
+				"%s: %s\n", __func__, abort_sources[i]);
+		return -EREMOTEIO;
+	}
+
 	for_each_bit(i, &abort_source, ARRAY_SIZE(abort_sources))
 		dev_err(dev->dev, "%s: %s\n", __func__, abort_sources[i]);
=20
 	if (abort_source & DW_IC_TX_ARB_LOST)
 		return -EAGAIN;
-	else if (abort_source & DW_IC_TX_ABRT_NOACK)
-		return -EREMOTEIO;
 	else if (abort_source & DW_IC_TX_ABRT_GCALL_READ)
 		return -EINVAL; /* wrong msgs[] data */
 	else
--=20
1.6.5.2


