Re: [PATCH 6/7] drm/i915: i2c: unconditionally set up gpio fallback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 14, 2012 at 19:37, Daniel Vetter <daniel.vetter@xxxxxxxx> 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@xxxxxxxxx>

--
Eugeni Dodonov

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux