[media] media: ti-vpe: vpdma: fix a timeout loop
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 25 Nov 2016 21:28:34 +0000 (19:28 -0200)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 3 Feb 2017 09:18:34 +0000 (07:18 -0200)
The check assumes that we end on zero but actually we end on -1.  Change
the post-op to a pre-op so that we do end on zero.  Techinically now we
only loop 499 times instead of 500 but that's fine.

Fixes: dc12b124353b ("[media] media: ti-vpe: vpdma: Add abort channel desc and cleanup APIs")

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/ti-vpe/vpdma.c

index 13bfd718416051d912a4a6f5ba529638f2db14c3..23472e3784ff169f0c05c9bcb473cccb6d9af0d0 100644 (file)
@@ -453,7 +453,7 @@ int vpdma_list_cleanup(struct vpdma_data *vpdma, int list_num,
        if (ret)
                return ret;
 
-       while (vpdma_list_busy(vpdma, list_num) && timeout--)
+       while (vpdma_list_busy(vpdma, list_num) && --timeout)
                ;
 
        if (timeout == 0) {