summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2021-06-14 13:23:39 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-07-12 14:22:10 +0200
commitb65836f40a748f14f402135a28fa75c6cca3e3fb (patch)
tree69da69de348daa40241efa4a75fd4b0ede6c7945 /drivers/media
parent75e7e58bfac11714159049c7f8c01f57cf7f39f2 (diff)
downloadlinux-stable-b65836f40a748f14f402135a28fa75c6cca3e3fb.tar.gz
linux-stable-b65836f40a748f14f402135a28fa75c6cca3e3fb.tar.bz2
linux-stable-b65836f40a748f14f402135a28fa75c6cca3e3fb.zip
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 <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>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/ti-vpe/cal.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c
index ec8ffc8d5721..9bba07647610 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);