The code was returning bad error numbers or just -1 in some cases.
Signed-off-by: Virupax Sadashivpetimath <virupax.sadashivpetimath@stericsson.com>
Reviewed-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
cause >= ARRAY_SIZE(abort_causes)
? "unknown reason" : abort_causes[cause]);
cause >= ARRAY_SIZE(abort_causes)
? "unknown reason" : abort_causes[cause]);
+ status = status ? status : dev->result;
+
goto out;
}
udelay(I2C_DELAY);
goto out;
}
udelay(I2C_DELAY);
| I2C_IT_RXFF | I2C_IT_RXFE));
if (dev->cli.count) {
| I2C_IT_RXFF | I2C_IT_RXFE));
if (dev->cli.count) {
dev_err(&dev->pdev->dev, "%lu bytes still remain to be"
"xfered\n", dev->cli.count);
(void) init_hw(dev);
dev_err(&dev->pdev->dev, "%lu bytes still remain to be"
"xfered\n", dev->cli.count);
(void) init_hw(dev);
/* Master Arbitration lost interrupt */
case I2C_IT_MAL:
/* Master Arbitration lost interrupt */
case I2C_IT_MAL:
(void) init_hw(dev);
i2c_set_bit(dev->virtbase + I2C_ICR, I2C_IT_MAL);
(void) init_hw(dev);
i2c_set_bit(dev->virtbase + I2C_ICR, I2C_IT_MAL);
* during the transaction.
*/
case I2C_IT_BERR:
* during the transaction.
*/
case I2C_IT_BERR:
/* get the status */
if (((readl(dev->virtbase + I2C_SR) >> 2) & 0x3) == I2C_ABORT)
(void) init_hw(dev);
/* get the status */
if (((readl(dev->virtbase + I2C_SR) >> 2) & 0x3) == I2C_ABORT)
(void) init_hw(dev);
* the Tx FIFO is full.
*/
case I2C_IT_TXFOVR:
* the Tx FIFO is full.
*/
case I2C_IT_TXFOVR:
(void) init_hw(dev);
dev_err(&dev->pdev->dev, "Tx Fifo Over run\n");
(void) init_hw(dev);
dev_err(&dev->pdev->dev, "Tx Fifo Over run\n");