Browse Source

i2c-designware: i2c_dw_handle_tx_abort: Use dev_dbg() for NOACK cases

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>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Shinya Kuribayashi 15 years ago
parent
commit
6d1ea0f6af
1 changed files with 7 additions and 2 deletions
  1. 7 2
      drivers/i2c/busses/i2c-designware.c

+ 7 - 2
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 = dev->abort_source;
 	unsigned long abort_source = dev->abort_source;
 	int i;
 	int i;
 
 
+	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))
 	for_each_bit(i, &abort_source, ARRAY_SIZE(abort_sources))
 		dev_err(dev->dev, "%s: %s\n", __func__, abort_sources[i]);
 		dev_err(dev->dev, "%s: %s\n", __func__, abort_sources[i]);
 
 
 	if (abort_source & DW_IC_TX_ARB_LOST)
 	if (abort_source & DW_IC_TX_ARB_LOST)
 		return -EAGAIN;
 		return -EAGAIN;
-	else if (abort_source & DW_IC_TX_ABRT_NOACK)
-		return -EREMOTEIO;
 	else if (abort_source & DW_IC_TX_ABRT_GCALL_READ)
 	else if (abort_source & DW_IC_TX_ABRT_GCALL_READ)
 		return -EINVAL; /* wrong msgs[] data */
 		return -EINVAL; /* wrong msgs[] data */
 	else
 	else