ret = i2c_read(chip, addr, alen, linebuf, linebytes);
#endif
if (ret)
- i2c_report_err(ret, I2C_ERR_READ);
+ return i2c_report_err(ret, I2C_ERR_READ);
else {
printf("%04x:", addr);
cp = linebuf;
ret = i2c_write(chip, addr++, alen, &byte, 1);
#endif
if (ret)
- i2c_report_err(ret, I2C_ERR_WRITE);
+ return i2c_report_err(ret, I2C_ERR_WRITE);
/*
* Wait for the write to complete. The write can take
* up to 10mSec (we allow a little more time).
ret = i2c_read(chip, addr, alen, (uchar *)&data, size);
#endif
if (ret)
- i2c_report_err(ret, I2C_ERR_READ);
- else {
- data = cpu_to_be32(data);
- if (size == 1)
- printf(" %02lx", (data >> 24) & 0x000000FF);
- else if (size == 2)
- printf(" %04lx", (data >> 16) & 0x0000FFFF);
- else
- printf(" %08lx", data);
- }
+ return i2c_report_err(ret, I2C_ERR_READ);
+
+ data = cpu_to_be32(data);
+ if (size == 1)
+ printf(" %02lx", (data >> 24) & 0x000000FF);
+ else if (size == 2)
+ printf(" %04lx", (data >> 16) & 0x0000FFFF);
+ else
+ printf(" %08lx", data);
nbytes = cli_readline(" ? ");
if (nbytes == 0) {
(uchar *)&data, size);
#endif
if (ret)
- i2c_report_err(ret, I2C_ERR_WRITE);
+ return i2c_report_err(ret,
+ I2C_ERR_WRITE);
#ifdef CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS
udelay(CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS * 1000);
#endif