summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2010-07-09 18:31:18 +0530
committerGary King <gking@nvidia.com>2010-07-09 10:09:52 -0700
commitcee2a685ea3a0d2fa708b0a02349af18187198a9 (patch)
tree6f8d7e19bbb479e93b3ed5cf7d321c2f17a586da
parentdcea9bbb855b9fcb34371ff4d021d5095adb5d4a (diff)
[arm/tegra]i2c:msg index should be valid for print error.
The index for msg during printing the NvRmI2cTransaction() status is out of the range. The msg index should be maximum of num -1 where num is number of messages. Fixing this issue to print correctly. Change-Id: I43841e3278e3041aae422ebe8bdef2dbd84b6084 Reviewed-on: http://git-master/r/3727 Reviewed-by: Gary King <gking@nvidia.com> Tested-by: Gary King <gking@nvidia.com>
-rw-r--r--drivers/i2c/busses/i2c-tegra.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index 7f0b8cf7ce60..a59fa2b20e1e 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -154,23 +154,23 @@ static int tegra_i2c_xfer(struct i2c_adapter *adap,
break;
case NvError_I2cDeviceNotFound:
dev_err(i2c_dev->dev, "no slave found on adapter %d at "
- "address 0x%x\n", i2c_bus->adapter.nr, msgs[i].addr);
+ "address 0x%x\n", i2c_bus->adapter.nr, msgs[0].addr);
rc = -ENXIO;
break;
case NvError_I2cReadFailed:
case NvError_I2cWriteFailed:
dev_err(i2c_dev->dev, "read/write failed on adapter %d at "
- "address 0x%x\n", i2c_bus->adapter.nr, msgs[i].addr);
+ "address 0x%x\n", i2c_bus->adapter.nr, msgs[0].addr);
rc = -EIO;
break;
case NvError_Timeout:
dev_err(i2c_dev->dev, "i2c timeout on adapter %d at "
- "address 0x%x\n", i2c_bus->adapter.nr, msgs[i].addr);
+ "address 0x%x\n", i2c_bus->adapter.nr, msgs[0].addr);
rc = -EIO;
break;
default:
dev_err(i2c_dev->dev, "unknown error on adapter %d at "
- "address 0x%x\n", i2c_bus->adapter.nr, msgs[i].addr);
+ "address 0x%x\n", i2c_bus->adapter.nr, msgs[0].addr);
rc = -ENXIO;
break;
}