From: Ville Syrjälä <[email protected]>

We're supposed to examine msgs[i] and msgs[i+1] to see if they
form a pair suitable for an indexed transfer. But in reality
we're examining msgs[0] and msgs[1]. Fix this.

Cc: [email protected]
Cc: Daniel Kurtz <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Sean Paul <[email protected]>
Fixes: 56f9eac05489 ("drm/i915/intel_i2c: use INDEX cycles for i2c read 
transactions")
Signed-off-by: Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/i915/intel_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
index eb5827110d8f..165375cbef2f 100644
--- a/drivers/gpu/drm/i915/intel_i2c.c
+++ b/drivers/gpu/drm/i915/intel_i2c.c
@@ -484,7 +484,7 @@ do_gmbus_xfer(struct i2c_adapter *adapter, struct i2c_msg 
*msgs, int num)
 
        for (; i < num; i += inc) {
                inc = 1;
-               if (gmbus_is_index_read(msgs, i, num)) {
+               if (gmbus_is_index_read(&msgs[i], i, num)) {
                        ret = gmbus_xfer_index_read(dev_priv, &msgs[i]);
                        inc = 2; /* an index read is two msgs */
                } else if (msgs[i].flags & I2C_M_RD) {
-- 
2.13.6

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to