summaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorTerry Lv <r65388@freescale.com>2010-01-08 15:40:17 +0800
committerTerry Lv <r65388@freescale.com>2010-01-11 19:34:31 +0800
commitb238637c05324a1ff5d16add1ae4bcfb587887dc (patch)
treee24331b915c34a605dc15de719ab6d68ea170bbf /drivers/i2c
parenta5510c49adac4e31c0bc13bad45ee073b3940dc5 (diff)
ENGR00119894: Read right value in mxc_i2c
The value read from mxc_i2c is not complete. The last byte is lost. Signed-off-by: Terry Lv <r65388@freescale.com>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/mxc_i2c.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
index eb3460e724d..6732b41f27b 100644
--- a/drivers/i2c/mxc_i2c.c
+++ b/drivers/i2c/mxc_i2c.c
@@ -3,7 +3,7 @@
*
* (c) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
*
- * (C) Copyright 2008-2009 Freescale Semiconductor, Inc.
+ * (C) Copyright 2008-2010 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
@@ -257,7 +257,7 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len)
ret = __REG16(I2C_BASE + I2DR);
while (len--) {
- if (len == 1)
+ if (len == 0)
__REG16(I2C_BASE + I2CR) = I2CR_IEN | I2CR_MSTA |
I2CR_TX_NO_AK;