> Subject: [PATCH] drm/amdgpu: fix logically dead code

The prefix here is wrong it should be drm/drm_dp_helper since that's where you 
end up doing change and not in amdgpu

> 
> The ternary operator inside the if block is redundant because the condition is
> always true in that context.
> 
> This patch removes the unnecessary check and returns `ret` directly.
> 
> Signed-off-by: Chelsy Ratnawat <chelsyratnawat2...@gmail.com>
> ---
>  drivers/gpu/drm/display/drm_dp_helper.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/display/drm_dp_helper.c
> b/drivers/gpu/drm/display/drm_dp_helper.c
> index 1ecc3df7e316..654d466183d5 100644
> --- a/drivers/gpu/drm/display/drm_dp_helper.c
> +++ b/drivers/gpu/drm/display/drm_dp_helper.c
> @@ -4227,7 +4227,7 @@ drm_edp_backlight_probe_state(struct drm_dp_aux
> *aux, struct drm_edp_backlight_i
>       if (ret < 0) {
>               drm_dbg_kms(aux->drm_dev, "%s: Failed to read backlight
> mode: %d\n",
>                           aux->name, ret);
> -             return ret < 0 ? ret : -EIO;
> +             return ret;

Here functions either expect a success or failure with -EIO since read byte 
return EPROTO
Or EBUSY we don't want that to propagate up.
So this needs to be 
return -EIO;

Regards,
Suraj Kandpal

>       }
> 
>       *current_mode = (mode_reg &
> DP_EDP_BACKLIGHT_CONTROL_MODE_MASK);
> --
> 2.47.3

Reply via email to