From: Tomi Valkeinen Date: Mon, 14 Jun 2021 11:23:39 +0000 (+0200) Subject: media: ti-vpe: cal: cleanup phy iteration in cal_remove X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b65836f40a748f14f402135a28fa75c6cca3e3fb;p=linux.git media: ti-vpe: cal: cleanup phy iteration in cal_remove 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 Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c index ec8ffc8d5721d..9bba07647610d 100644 --- a/drivers/media/platform/ti-vpe/cal.c +++ b/drivers/media/platform/ti-vpe/cal.c @@ -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);