All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/bridge: analogix-anx6345: Fix drm_dp_link helper removal
@ 2019-11-30 14:52 Torsten Duwe
  0 siblings, 0 replies; only message in thread
From: Torsten Duwe @ 2019-11-30 14:52 UTC (permalink / raw)
  To: Maxime Ripard, Daniel Vetter; +Cc: Sean Paul, dri-devel

drm_dp_link_rate_to_bw_code and ...bw_code_to_link_rate simply divide by
and multiply with 27000, respectively. Avoid an overflow in the u8 dpcd[0]
and the multiply+divide alltogether.

fixes: e1cff82c1097bda2478 ("fix anx6345 compilation for v5.5")
Signed-off-by: Torsten Duwe <duwe@suse.de>
---
Same as 78xx before. Code copied over in a rush, not realising
it was broken by itself.

--- a/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c
@@ -210,10 +210,9 @@ static int anx6345_dp_link_training(struct anx6345 *anx6345)
 	if (err)
 		return err;
 
-	dpcd[0] = drm_dp_max_link_rate(anx6345->dpcd);
-	dpcd[0] = drm_dp_link_rate_to_bw_code(dpcd[0]);
 	err = regmap_write(anx6345->map[I2C_IDX_DPTX],
-			   SP_DP_MAIN_LINK_BW_SET_REG, dpcd[0]);
+			   SP_DP_MAIN_LINK_BW_SET_REG,
+			   anx6345->dpcd[DP_MAX_LINK_RATE]);
 	if (err)
 		return err;
 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-30 14:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-30 14:52 [PATCH] drm/bridge: analogix-anx6345: Fix drm_dp_link helper removal Torsten Duwe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.