aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses
diff options
context:
space:
mode:
authorShinya Kuribayashi <shinya.kuribayashi@necel.com>2009-11-16 06:40:14 -0500
committerBen Dooks <ben-linux@fluff.org>2009-12-08 19:19:13 -0500
commit6d1ea0f6afde6887d6dea2ace1714a23d9b5820d (patch)
tree3acb20e31d87b19cf3c9ffb050ca12b7500ff274 /drivers/i2c/busses
parenta0e06ea64cd2b4b7eee9c196bf623d6c9e44df7c (diff)
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>
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r--drivers/i2c/busses/i2c-designware.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-designware.c b/drivers/i2c/busses/i2c-designware.c
index 4534d4554ff4..9e18ef97f156 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)
496 unsigned long abort_source = dev->abort_source; 496 unsigned long abort_source = dev->abort_source;
497 int i; 497 int i;
498 498
499 if (abort_source & DW_IC_TX_ABRT_NOACK) {
500 for_each_bit(i, &abort_source, ARRAY_SIZE(abort_sources))
501 dev_dbg(dev->dev,
502 "%s: %s\n", __func__, abort_sources[i]);
503 return -EREMOTEIO;
504 }
505
499 for_each_bit(i, &abort_source, ARRAY_SIZE(abort_sources)) 506 for_each_bit(i, &abort_source, ARRAY_SIZE(abort_sources))
500 dev_err(dev->dev, "%s: %s\n", __func__, abort_sources[i]); 507 dev_err(dev->dev, "%s: %s\n", __func__, abort_sources[i]);
501 508
502 if (abort_source & DW_IC_TX_ARB_LOST) 509 if (abort_source & DW_IC_TX_ARB_LOST)
503 return -EAGAIN; 510 return -EAGAIN;
504 else if (abort_source & DW_IC_TX_ABRT_NOACK)
505 return -EREMOTEIO;
506 else if (abort_source & DW_IC_TX_ABRT_GCALL_READ) 511 else if (abort_source & DW_IC_TX_ABRT_GCALL_READ)
507 return -EINVAL; /* wrong msgs[] data */ 512 return -EINVAL; /* wrong msgs[] data */
508 else 513 else