UPSTREAM: 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)
committerGrant Grundler <grundler@google.com>
Thu, 24 May 2012 22:13:19 +0000 (15:13 -0700)
commitcee3867127c51d84e90679692e2a4b5b5f44f91f
treec7c64aece5fe10db547f4a2fa3b6a5fbe53be700
parente7a91b171003574ad96a622ede3e7a6badc52e33
UPSTREAM: 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>
(cherry picked from commit 90e6b26d6b28ade684a4b16b856a74f27bc644bc)

Change-Id: I3ed6c8720e75f4e3a246128ba01b8cc9fc114f6b
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
drivers/gpu/drm/i915/intel_i2c.c