From: Jim Chargin Date: Fri, 26 Apr 2013 21:25:12 +0000 (UTC) Subject: [U-Boot] =?utf-8?q?=5BPATCH_v4_4/7=5D_i2c=3A_fsl=5Fi2c=3Ai2c=5Fre?= =?utf-8?q?ad=28=29=3A_dont_try_to_write=09address_w/_alen=3D0?= References: <1366963900-2784-1-git-send-email-dirk.eibach@gdsys.cc> <1366963900-2784-5-git-send-email-dirk.eibach@gdsys.cc> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dirk Eibach gdsys.cc> writes: > > From: Reinhard Pfau gdsys.de> > > if alen is 0: no longer start a write cycle before reading data. > > Signed-off-by: Dirk Eibach gdsys.cc> > Signed-off-by: Reinhard Pfau gdsys.cc> > Since I saw no response to my previous email, http://article.gmane.org/gmane.comp.boot-loaders.u-boot/159456, I looked a little more closely. > --- > Changes in v4: None > Changes in v3: None > Changes in v2: > - whitespace fixes > > drivers/i2c/fsl_i2c.c | 9 ++++++--- > 1 files changed, 6 insertions(+), 3 deletions(-) > > diff --git a/drivers/i2c/fsl_i2c.c b/drivers/i2c/fsl_i2c.c > index 1c7265d..ab86bef 100644 > --- a/drivers/i2c/fsl_i2c.c > +++ b/drivers/i2c/fsl_i2c.c > -383,13 +383,16 i2c_read(u8 dev, uint addr, int alen, u8 *data, int length) > int i = -1; /* signal error */ > u8 *a = (u8*)&addr; > > - if (i2c_wait4bus() >= 0 > + if (i2c_wait4bus() < 0) > + return -1; > + > + if (alen > 0 > On visual inspection of $(UBOOT)/drivers/i2c/fsl_i2c.c, these proposed changes will cause i2c_probe(), in the same source file, to fail. i2c_probe() calls i2c_read() with alen=0. Unless I'm missing something. Jim