drm/i915/intel_i2c: reuse GMBUS2 value read in polling loop
authorDaniel Kurtz <djkurtz@chromium.org>
Fri, 30 Mar 2012 11:46:41 +0000 (19:46 +0800)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 12 Apr 2012 19:14:08 +0000 (21:14 +0200)
commit90e6b26d6b28ade684a4b16b856a74f27bc644bc
tree50a2eac20cadf42fe40a1be15527dbe6b2bdfaea
parent56f9eac05489912ac0165ffc0ebff0f8588f77d2
drm/i915/intel_i2c: reuse GMBUS2 value read in polling loop

Save the GMBUS2 value read while polling for state changes, and then
reuse this value when determining for which reason the loops were exited.
This is a small optimization which saves a couple of bus accesses for
memory mapped IO registers.

To avoid "assigning in if clause" checkpatch errors", use a ret variable
to store the wait_for macro return value.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_i2c.c