aboutsummaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorVirupax Sadashivpetimath <virupax.sadashivpetimath@stericsson.com>2011-01-04 16:56:46 +0530
committerSrinidhi KASAGAR <srinidhi.kasagar@stericsson.com>2011-01-13 07:11:38 +0100
commitfc396a31b8b6b8b937e737f5392305d9f72542f9 (patch)
tree176a2594fd113795db365b73bedb7a593206b4ec /drivers/i2c
parent56b18c15af8be1e59ee672c6a767ff1a2eb4b26b (diff)
plat-nomadik: i2c-nomadik: Correct errno used
Correct 1) Errno returned. 2) I2C Speed mode values. ST-Ericsson ID: ER318303 Change-Id: I103703d014d3baba87494de50725bf5149ff9797 Signed-off-by: Virupax Sadashivpetimath <virupax.sadashivpetimath@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/11834 Reviewed-by: QATOOLS Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-nomadik.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c
index 66a3adf5e9e..49c5b0cd9ed 100644
--- a/drivers/i2c/busses/i2c-nomadik.c
+++ b/drivers/i2c/busses/i2c-nomadik.c
@@ -616,6 +616,8 @@ static int nmk_i2c_xfer(struct i2c_adapter *i2c_adap,
cause >= ARRAY_SIZE(abort_causes)
? "unknown reason" : abort_causes[cause]);
+ status = status ? status : dev->result;
+
goto out;
}
udelay(I2C_DELAY);
@@ -759,7 +761,7 @@ static irqreturn_t i2c_irq_handler(int irq, void *arg)
| I2C_IT_RXFF | I2C_IT_RXFE));
if (dev->cli.count) {
- dev->result = -1;
+ dev->result = -EIO;
dev_err(&dev->pdev->dev, "%lu bytes still remain to be"
"xfered\n", dev->cli.count);
(void) init_hw(dev);
@@ -770,7 +772,7 @@ static irqreturn_t i2c_irq_handler(int irq, void *arg)
/* Master Arbitration lost interrupt */
case I2C_IT_MAL:
- dev->result = -1;
+ dev->result = -EIO;
(void) init_hw(dev);
i2c_set_bit(dev->virtbase + I2C_ICR, I2C_IT_MAL);
@@ -784,7 +786,7 @@ static irqreturn_t i2c_irq_handler(int irq, void *arg)
* during the transaction.
*/
case I2C_IT_BERR:
- dev->result = -1;
+ dev->result = -EIO;
/* get the status */
if (((readl(dev->virtbase + I2C_SR) >> 2) & 0x3) == I2C_ABORT)
(void) init_hw(dev);
@@ -800,7 +802,7 @@ static irqreturn_t i2c_irq_handler(int irq, void *arg)
* the Tx FIFO is full.
*/
case I2C_IT_TXFOVR:
- dev->result = -1;
+ dev->result = -EIO;
(void) init_hw(dev);
dev_err(&dev->pdev->dev, "Tx Fifo Over run\n");