drm/i915/dpcd_bl: Handle drm_dpcd_read/write() return values correctly
authorLyude Paul <lyude@redhat.com>
Fri, 14 May 2021 18:14:56 +0000 (14:14 -0400)
committerLyude Paul <lyude@redhat.com>
Wed, 9 Jun 2021 17:35:18 +0000 (13:35 -0400)
commit3faea9939a3d1eb5a40f3f6100c24792865b6445
treecdab0004241653f7b1ce19e374770d431b1eba2e
parent4154fa0e2688118ba3dbc67aa834435463f9ea68
drm/i915/dpcd_bl: Handle drm_dpcd_read/write() return values correctly

This is kind of an annoying aspect of DRM's DP helpers:
drm_dp_dpcd_readb/writeb() return the size of bytes read/written on
success, thus we want to check against that instead of checking if the
return value is less than 0.

I'll probably be fixing this in the near future once I start doing DP work
again, also because I'd rather not mix a tree-wide refactor like that in
with a patch series intended to be around introducing DP backlight helpers.
So, for now let's just handle the return values from each function
correctly.

Signed-off-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210514181504.565252-3-lyude@redhat.com
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c