From: Masahiro Yamada Date: Wed, 03 Dec 2014 22:30:31 +0900 Subject: [U-Boot] [PATCH v3 10/10] dm: i2c: tegra: Convert to driver model In-Reply-To: <1416855444-32016-11-git-send-email-sjg@chromium.org> References: <1416855444-32016-1-git-send-email-sjg@chromium.org> <1416855444-32016-11-git-send-email-sjg@chromium.org> Message-ID: <20141203223031.B197.AA925319@jp.panasonic.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Simon, Another comment for this patch. On Mon, 24 Nov 2014 11:57:24 -0700 Simon Glass wrote: > -/* Probe to see if a chip is present. */ > -static int tegra_i2c_probe(struct i2c_adapter *adap, uchar chip) > +static int tegra_i2c_set_offset_len(struct udevice *dev, const uint olen) > { > - struct i2c_bus *bus; > - int rc; > - uchar reg; > - > - debug("i2c_probe: addr=0x%x\n", chip); > - bus = tegra_i2c_get_bus(adap); > - if (!bus) > - return 1; > - reg = 0; > - rc = i2c_write_data(bus, chip, ®, 1, false); > - if (rc) { > - debug("Error probing 0x%x.\n", chip); > - return 1; > - } > - return 0; > -} > + if (olen < 4) > + return 0; The maximum length 4 is not tegra-specific. I can't find good reason to have .set_offset_len handler. Best Regards Masahiro Yamada