<div class="gmail_quote">On Tue, Feb 14, 2012 at 19:37, Daniel Vetter <span dir="ltr">&lt;<a href="mailto:daniel.vetter@ffwll.ch">daniel.vetter@ffwll.ch</a>&gt;</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-&gt;force_bit = intel_gpio_create(bus, bus-&gt;reg0 &amp; 0xff);<br>
-       if (!bus-&gt;force_bit)<br>
-               ret = -ENOMEM;<br>
-       else<br>
-               ret = intel_i2c_quirk_xfer(bus, bus-&gt;force_bit, msgs, num);<br>
+       ret = -EIO;<br>
+       if (bus-&gt;has_gpio) {<br>
+               bus-&gt;force_bit = true;<br>
+               ret = intel_i2c_quirk_xfer(bus, msgs, num);<br>
+       }<br></blockquote><div><br>&lt;bikeshedding&gt;<br>Wouldn&#39;t it be cleaner and more consistent with the rest of the code to use:<br><br>if (!bus-&gt;has_gpio)<br>    ret = -EIO;<br>else {<br>    bus-&gt;force_bit = true;<br>

    ret = intel_i2c_quirk_xfer(bus, msgs, num);<br>}<br><br>instead?<br>&lt;/bikeshedding&gt;<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 &lt;<a href="mailto:eugeni.dodonov@intel.com">eugeni.dodonov@intel.com</a>&gt;<br>

<br>-- <br>Eugeni Dodonov<a href="http://eugeni.dodonov.net/" target="_blank"><br></a><br>