Skip to content

Commit cdd296c

Browse files
Tom Rixpatjak
authored andcommitted
drm/gma500: fix error check
Reviewing this block of code in cdv_intel_dp_init() ret = cdv_intel_dp_aux_native_read(gma_encoder, DP_DPCD_REV, ... cdv_intel_edp_panel_vdd_off(gma_encoder); if (ret == 0) { /* if this fails, presume the device is a ghost */ DRM_INFO("failed to retrieve link info, disabling eDP\n"); drm_encoder_cleanup(encoder); cdv_intel_dp_destroy(connector); goto err_priv; } else { The (ret == 0) is not strict enough. cdv_intel_dp_aux_native_read() returns > 0 on success otherwise it is failure. So change to <= Fixes: d112a81 ("gma500/cdv: Add eDP support") Signed-off-by: Tom Rix <[email protected]> Signed-off-by: Patrik Jakobsson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 172c1e8 commit cdd296c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/gma500/cdv_intel_dp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2078,7 +2078,7 @@ cdv_intel_dp_init(struct drm_device *dev, struct psb_intel_mode_device *mode_dev
20782078
intel_dp->dpcd,
20792079
sizeof(intel_dp->dpcd));
20802080
cdv_intel_edp_panel_vdd_off(gma_encoder);
2081-
if (ret == 0) {
2081+
if (ret <= 0) {
20822082
/* if this fails, presume the device is a ghost */
20832083
DRM_INFO("failed to retrieve link info, disabling eDP\n");
20842084
drm_encoder_cleanup(encoder);

0 commit comments

Comments
 (0)