<div class="gmail_quote">On Tue, Feb 14, 2012 at 19:37, Daniel Vetter <span dir="ltr"><<a href="mailto:daniel.vetter@ffwll.ch">daniel.vetter@ffwll.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
/* Hardware may not support GMBUS over these pins? Try GPIO bitbanging instead. */<br>
- bus->force_bit = intel_gpio_create(bus, bus->reg0 & 0xff);<br>
- if (!bus->force_bit)<br>
- ret = -ENOMEM;<br>
- else<br>
- ret = intel_i2c_quirk_xfer(bus, bus->force_bit, msgs, num);<br>
+ ret = -EIO;<br>
+ if (bus->has_gpio) {<br>
+ bus->force_bit = true;<br>
+ ret = intel_i2c_quirk_xfer(bus, msgs, num);<br>
+ }<br></blockquote><div><br><bikeshedding><br>Wouldn't it be cleaner and more consistent with the rest of the code to use:<br><br>if (!bus->has_gpio)<br> ret = -EIO;<br>else {<br> bus->force_bit = true;<br>
ret = intel_i2c_quirk_xfer(bus, msgs, num);<br>}<br><br>instead?<br></bikeshedding><br><br>Other than that, it looks correct to me, and certainly makes code more clean.<br clear="all"></div></div><br>Reviewed-by: Eugeni Dodonov <<a href="mailto:eugeni.dodonov@intel.com">eugeni.dodonov@intel.com</a>><br>
<br>-- <br>Eugeni Dodonov<a href="http://eugeni.dodonov.net/" target="_blank"><br></a><br>