summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormario.six@gdsys.cc <mario.six@gdsys.cc>2016-04-25 08:31:04 +0200
committerHeiko Schocher <hs@denx.de>2016-05-17 08:28:53 +0200
commit03a112aad6893ab1059e716b7bfc36fe759eaec5 (patch)
tree76cfdb542c421da14cf3afa4a4fcae0e30d77c6d
parent386b276918541f4108b56f0c7c422b64396f64f2 (diff)
downloadu-boot-imx-03a112aad6893ab1059e716b7bfc36fe759eaec5.zip
u-boot-imx-03a112aad6893ab1059e716b7bfc36fe759eaec5.tar.gz
u-boot-imx-03a112aad6893ab1059e716b7bfc36fe759eaec5.tar.bz2
dm: fsl_i2c: Remove unnecessary variable
Signed-off-by: Mario Six <mario.six@gdsys.cc>
-rw-r--r--drivers/i2c/fsl_i2c.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/i2c/fsl_i2c.c b/drivers/i2c/fsl_i2c.c
index 18b8848..4bc1dda 100644
--- a/drivers/i2c/fsl_i2c.c
+++ b/drivers/i2c/fsl_i2c.c
@@ -423,7 +423,6 @@ fsl_i2c_read(struct i2c_adapter *adap, u8 chip_addr, uint offset, int olen,
(struct fsl_i2c_base *)i2c_base[adap->hwadapnr];
int ret = -1; /* signal error */
u8 *o = (u8 *)&offset;
- int len = olen * -1;
if (i2c_wait4bus(adap) < 0)
return -1;
@@ -437,9 +436,9 @@ fsl_i2c_read(struct i2c_adapter *adap, u8 chip_addr, uint offset, int olen,
*/
if (olen < 0) {
if (i2c_write_addr(adap, chip_addr, I2C_WRITE_BIT, 0) != 0)
- ret = __i2c_write(adap, data, len);
+ ret = __i2c_write(adap, data, -olen);
- if (ret != len)
+ if (ret != -olen)
return -1;
if (dlen && i2c_write_addr(adap, chip_addr,