Commit d0a7b6de authored by Jani Nikula's avatar Jani Nikula Committed by Daniel Vetter

drm/i915/sdvo: fix questionable return value check

intel_sdvo_get_trained_inputs() returns a bool, check the status
accordingly.
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent df6f783a
...@@ -1461,7 +1461,7 @@ static void intel_enable_sdvo(struct intel_encoder *encoder) ...@@ -1461,7 +1461,7 @@ static void intel_enable_sdvo(struct intel_encoder *encoder)
u32 temp; u32 temp;
bool input1, input2; bool input1, input2;
int i; int i;
u8 status; bool success;
temp = I915_READ(intel_sdvo->sdvo_reg); temp = I915_READ(intel_sdvo->sdvo_reg);
if ((temp & SDVO_ENABLE) == 0) { if ((temp & SDVO_ENABLE) == 0) {
...@@ -1475,12 +1475,12 @@ static void intel_enable_sdvo(struct intel_encoder *encoder) ...@@ -1475,12 +1475,12 @@ static void intel_enable_sdvo(struct intel_encoder *encoder)
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
intel_wait_for_vblank(dev, intel_crtc->pipe); intel_wait_for_vblank(dev, intel_crtc->pipe);
status = intel_sdvo_get_trained_inputs(intel_sdvo, &input1, &input2); success = intel_sdvo_get_trained_inputs(intel_sdvo, &input1, &input2);
/* Warn if the device reported failure to sync. /* Warn if the device reported failure to sync.
* A lot of SDVO devices fail to notify of sync, but it's * A lot of SDVO devices fail to notify of sync, but it's
* a given it the status is a success, we succeeded. * a given it the status is a success, we succeeded.
*/ */
if (status == SDVO_CMD_STATUS_SUCCESS && !input1) { if (success && !input1) {
DRM_DEBUG_KMS("First %s output reported failure to " DRM_DEBUG_KMS("First %s output reported failure to "
"sync\n", SDVO_NAME(intel_sdvo)); "sync\n", SDVO_NAME(intel_sdvo));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment