[PATCH] drm/mediatek: fix a loop timeout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We expected to end with "timeout_ms" set to zero, but it's a post-op so
the current code ends with -1.  Let's fix this by changing it to a
pre-op.

Fixes: 21898816831f ("drm/mediatek: add dsi transfer function")
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
index 808b995a990f..3a0b6d1057a2 100644
--- a/drivers/gpu/drm/mediatek/mtk_dsi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
@@ -902,7 +902,7 @@ static void mtk_dsi_wait_for_idle(struct mtk_dsi *dsi)
 {
 	u32 timeout_ms = 500000; /* total 1s ~ 2s timeout */
 
-	while (timeout_ms--) {
+	while (--timeout_ms) {
 		if (!(readl(dsi->regs + DSI_INTSTA) & DSI_BUSY))
 			break;
 
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux