diff mbox series

[v3,29/38] media: ti-vpe: cal: cleanup phy iteration in cal_remove

Message ID 20210524110909.672432-30-tomi.valkeinen@ideasonboard.com
State Accepted
Commit b65836f40a748f14f402135a28fa75c6cca3e3fb
Headers show
Series media: ti-vpe: cal: multistream & embedded data support | expand

Commit Message

Tomi Valkeinen May 24, 2021, 11:09 a.m. UTC
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>
---
 drivers/media/platform/ti-vpe/cal.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Laurent Pinchart June 4, 2021, 1:52 p.m. UTC | #1
Hi Tomi,

Thank you for the patch.

On Mon, May 24, 2021 at 02:09:00PM +0300, Tomi Valkeinen wrote:
> 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>


> ---

>  drivers/media/platform/ti-vpe/cal.c | 6 ++----

>  1 file changed, 2 insertions(+), 4 deletions(-)

> 

> diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c

> index d43972c392fc..bb99d0ce796f 100644

> --- a/drivers/media/platform/ti-vpe/cal.c

> +++ b/drivers/media/platform/ti-vpe/cal.c

> @@ -1173,10 +1173,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);

>  


-- 
Regards,

Laurent Pinchart
diff mbox series

Patch

diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c
index d43972c392fc..bb99d0ce796f 100644
--- a/drivers/media/platform/ti-vpe/cal.c
+++ b/drivers/media/platform/ti-vpe/cal.c
@@ -1173,10 +1173,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);