[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 at 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 at intel.com>

-- 
Eugeni Dodonov
<http://eugeni.dodonov.net/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20120214/a59f3d5e/attachment-0001.htm>


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux