On Tue, Feb 14, 2012 at 19:37, Daniel Vetter daniel.vetter@ffwll.ch wrote:
/* Hardware may not support GMBUS over these pins? Try GPIO
bitbanging instead. */
bus->force_bit = intel_gpio_create(bus, bus->reg0 & 0xff);
if (!bus->force_bit)
ret = -ENOMEM;
else
ret = intel_i2c_quirk_xfer(bus, bus->force_bit, msgs, num);
ret = -EIO;
if (bus->has_gpio) {
bus->force_bit = true;
ret = intel_i2c_quirk_xfer(bus, msgs, num);
}
<bikeshedding> Wouldn't it be cleaner and more consistent with the rest of the code to use:
if (!bus->has_gpio) ret = -EIO; else { bus->force_bit = true; ret = intel_i2c_quirk_xfer(bus, msgs, num); }
instead? </bikeshedding>
Other than that, it looks correct to me, and certainly makes code more clean.
Reviewed-by: Eugeni Dodonov eugeni.dodonov@intel.com