i2c-nomadik: reset the hw after status check
[pandora-kernel.git] / drivers / i2c / busses / i2c-nomadik.c
index b2de1a5..fa7b106 100644 (file)
@@ -428,10 +428,9 @@ static int read_i2c(struct nmk_i2c_dev *dev)
        }
 
        if (timeout == 0) {
-               /* controller has timedout, re-init the h/w */
+               /* Controller timed out */
                dev_err(&dev->pdev->dev, "read from slave 0x%x timed out\n",
                                dev->cli.slave_adr);
-               (void) init_hw(dev);
                status = -ETIMEDOUT;
        }
        return status;
@@ -516,10 +515,9 @@ static int write_i2c(struct nmk_i2c_dev *dev)
        }
 
        if (timeout == 0) {
-               /* controller has timedout, re-init the h/w */
+               /* Controller timed out */
                dev_err(&dev->pdev->dev, "write to slave 0x%x timed out\n",
                                dev->cli.slave_adr);
-               (void) init_hw(dev);
                status = -ETIMEDOUT;
        }
 
@@ -638,6 +636,8 @@ static int nmk_i2c_xfer(struct i2c_adapter *i2c_adap,
                                                abort_causes[cause]);
                                }
 
+                               (void) init_hw(dev);
+
                                status = status ? status : dev->result;
 
                                break;