aboutsummaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorVirupax Sadashivpetimath <virupax.sadashivpetimath@stericsson.com>2011-04-11 10:33:22 +0530
committerSrinidhi KASAGAR <srinidhi.kasagar@stericsson.com>2011-04-21 14:21:27 +0200
commit360791e8963a0e7357da48edc195600d67ab53c4 (patch)
treeba01f76f16826b7e1c6d42d354df29f8fe1856a2 /drivers/i2c
parentfdb3586859f4271b1f253e71f47717ce4c4e8ba2 (diff)
i2c-nomadik: Reset the hw after status check
In case of I2C timeout, reset the HW only after the HW status is read, otherwise the staus will be lost. ST-Ericsson ID: ER334949 Change-Id: I93295122fa38d0ea82780d54af7f5de1fa099369 Signed-off-by: Virupax Sadashivpetimath <virupax.sadashivpetimath@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/20986 Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-nomadik.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c
index dfcb0e0d2fe..e9583899ee3 100644
--- a/drivers/i2c/busses/i2c-nomadik.c
+++ b/drivers/i2c/busses/i2c-nomadik.c
@@ -428,10 +428,9 @@ static int read_i2c(struct nmk_i2c_dev *dev)
}
if (timeout == 0) {
- /* controler 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;
}
@@ -517,10 +516,9 @@ static int write_i2c(struct nmk_i2c_dev *dev)
}
if (timeout == 0) {
- /* controler 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;
}
@@ -639,6 +637,8 @@ static int nmk_i2c_xfer(struct i2c_adapter *i2c_adap,
abort_causes[cause]);
}
+ (void) init_hw(dev);
+
status = status ? status : dev->result;
break;