Skip to contentSkip to conversation

drm/bridge: synopsys: dw-dp: fix bool function returning negative error code

PATCH New Bob ynn 1 participant 1 message May 15

Subsystems (4)
lore
Share & tools
lore

Bob ynn

author
#0 lore raw

PATCH 1/1 drm/bridge: synopsys: dw-dp: fix bool function returning negative error code

From: yanlonglong <[email protected]>

The function dw_dp_video_need_vsc_sdp() is declared to return bool, but it returns -EINVAL when dw_dp_get_bridge_state() fails. Since -EINVAL is a non-zero value (-22), it is implicitly converted to true, which is the opposite of the intended behavior

Fixes 86eecc3a9c2e("drm/bridge: synopsys: Add DW DPTX Controller support library")
---
 drivers/gpu/drm/bridge/synopsys/dw-dp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/synopsys/dw-dp.c +1 -1
index 21541be094c4..7b99d91b3456 100644
@@ -1143,7 +1143,7 @@ static bool dw_dp_video_need_vsc_sdp(struct dw_dp *dp)
 
 	state = dw_dp_get_bridge_state(dp);
 	if (!state)
-		return -EINVAL;
+		return false;
 
 	if (!link->vsc_sdp_supported)
 		return false;
Signature · 1 line
2.43.0