media: ti-vpe: cal: cleanup phy iteration in cal_remove
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Mon, 14 Jun 2021 11:23:39 +0000 (13:23 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 12 Jul 2021 12:22:10 +0000 (14:22 +0200)
Most of the driver has moved from ARRAY_SIZE(cal->phy) to
cal->data->num_csi2_phy, but we have one place left in cal_remove. Also,
checking for cal->phy[i] != NULL is not needed as we always have all the
phys instantiated.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/ti-vpe/cal.c

index ec8ffc8..9bba076 100644 (file)
@@ -1188,10 +1188,8 @@ static int cal_remove(struct platform_device *pdev)
 
        cal_media_unregister(cal);
 
-       for (i = 0; i < ARRAY_SIZE(cal->phy); i++) {
-               if (cal->phy[i])
-                       cal_camerarx_disable(cal->phy[i]);
-       }
+       for (i = 0; i < cal->data->num_csi2_phy; i++)
+               cal_camerarx_disable(cal->phy[i]);
 
        cal_media_cleanup(cal);