Skip to content

Commit 0aeb904

Browse files
committed
drm/i915: simplify gmbus xfer error checks
Shorter, easier to follow code with no functional changes. In all cases, the return value ultimately comes from gmbus_wait_hw_status() anyway. Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1448980166-23055-1-git-send-email-jani.nikula@intel.com
1 parent 79bd23d commit 0aeb904

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

drivers/gpu/drm/i915/intel_i2c.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -505,17 +505,13 @@ gmbus_xfer(struct i2c_adapter *adapter,
505505
ret = gmbus_xfer_write(dev_priv, &msgs[i]);
506506
}
507507

508+
if (!ret)
509+
ret = gmbus_wait_hw_status(dev_priv, GMBUS_HW_WAIT_PHASE,
510+
GMBUS_HW_WAIT_EN);
508511
if (ret == -ETIMEDOUT)
509512
goto timeout;
510-
if (ret == -ENXIO)
513+
else if (ret)
511514
goto clear_err;
512-
513-
ret = gmbus_wait_hw_status(dev_priv, GMBUS_HW_WAIT_PHASE,
514-
GMBUS_HW_WAIT_EN);
515-
if (ret == -ENXIO)
516-
goto clear_err;
517-
if (ret)
518-
goto timeout;
519515
}
520516

521517
/* Generate a STOP condition on the bus. Note that gmbus can't generata

0 commit comments

Comments
 (0)