diff mbox series

[v5,4/7] media: vsp1: wpf: Propagate vsp1_rwpf_init_ctrls()

Message ID 20250319-v4h-iif-v5-4-0a10456d792c@ideasonboard.com (mailing list archive)
State New
Headers show
Series media: renesas: vsp1: Add support for IIF | expand

Commit Message

Jacopo Mondi March 19, 2025, 11:28 a.m. UTC
vsp1_wpf.c calls vsp1_rwpf_init_ctrls() to initialize controls that
are common between RPF and WPF.

However, the vsp1_wpf.c implementation does not check for the function
call return value. Fix this by propagating to the caller the return
value.

While at it, drop a duplicated error message in wpf_init_controls() as
the caller already report it.

Signed-off-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com>

---
v2->v3:
  - New patch
---
 drivers/media/platform/renesas/vsp1/vsp1_wpf.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Laurent Pinchart March 21, 2025, 11:59 a.m. UTC | #1
Hi Jacopo,

Thank you for the patch.

On Wed, Mar 19, 2025 at 12:28:17PM +0100, Jacopo Mondi wrote:
> vsp1_wpf.c calls vsp1_rwpf_init_ctrls() to initialize controls that
> are common between RPF and WPF.
> 
> However, the vsp1_wpf.c implementation does not check for the function
> call return value. Fix this by propagating to the caller the return
> value.
> 
> While at it, drop a duplicated error message in wpf_init_controls() as
> the caller already report it.
> 
> Signed-off-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> 
> ---
> v2->v3:
>   - New patch
> ---
>  drivers/media/platform/renesas/vsp1/vsp1_wpf.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/media/platform/renesas/vsp1/vsp1_wpf.c b/drivers/media/platform/renesas/vsp1/vsp1_wpf.c
> index f176750ccd9847fdb8d51f7f51a6bd5092b70197..da651a882bbb7e4d58f2dfea9dcea60a41f4f79c 100644
> --- a/drivers/media/platform/renesas/vsp1/vsp1_wpf.c
> +++ b/drivers/media/platform/renesas/vsp1/vsp1_wpf.c
> @@ -133,6 +133,7 @@ static int wpf_init_controls(struct vsp1_rwpf *wpf)
>  {
>  	struct vsp1_device *vsp1 = wpf->entity.vsp1;
>  	unsigned int num_flip_ctrls;
> +	int ret;
>  
>  	spin_lock_init(&wpf->flip.lock);
>  
> @@ -156,7 +157,9 @@ static int wpf_init_controls(struct vsp1_rwpf *wpf)
>  		num_flip_ctrls = 0;
>  	}
>  
> -	vsp1_rwpf_init_ctrls(wpf, num_flip_ctrls);
> +	ret = vsp1_rwpf_init_ctrls(wpf, num_flip_ctrls);
> +	if (ret < 0)
> +		return ret;
>  
>  	if (num_flip_ctrls >= 1) {
>  		wpf->flip.ctrls.vflip =
> @@ -174,11 +177,8 @@ static int wpf_init_controls(struct vsp1_rwpf *wpf)
>  		v4l2_ctrl_cluster(3, &wpf->flip.ctrls.vflip);
>  	}
>  
> -	if (wpf->ctrls.error) {
> -		dev_err(vsp1->dev, "wpf%u: failed to initialize controls\n",
> -			wpf->entity.index);
> +	if (wpf->ctrls.error)
>  		return wpf->ctrls.error;
> -	}
>  
>  	return 0;
>  }
diff mbox series

Patch

diff --git a/drivers/media/platform/renesas/vsp1/vsp1_wpf.c b/drivers/media/platform/renesas/vsp1/vsp1_wpf.c
index f176750ccd9847fdb8d51f7f51a6bd5092b70197..da651a882bbb7e4d58f2dfea9dcea60a41f4f79c 100644
--- a/drivers/media/platform/renesas/vsp1/vsp1_wpf.c
+++ b/drivers/media/platform/renesas/vsp1/vsp1_wpf.c
@@ -133,6 +133,7 @@  static int wpf_init_controls(struct vsp1_rwpf *wpf)
 {
 	struct vsp1_device *vsp1 = wpf->entity.vsp1;
 	unsigned int num_flip_ctrls;
+	int ret;
 
 	spin_lock_init(&wpf->flip.lock);
 
@@ -156,7 +157,9 @@  static int wpf_init_controls(struct vsp1_rwpf *wpf)
 		num_flip_ctrls = 0;
 	}
 
-	vsp1_rwpf_init_ctrls(wpf, num_flip_ctrls);
+	ret = vsp1_rwpf_init_ctrls(wpf, num_flip_ctrls);
+	if (ret < 0)
+		return ret;
 
 	if (num_flip_ctrls >= 1) {
 		wpf->flip.ctrls.vflip =
@@ -174,11 +177,8 @@  static int wpf_init_controls(struct vsp1_rwpf *wpf)
 		v4l2_ctrl_cluster(3, &wpf->flip.ctrls.vflip);
 	}
 
-	if (wpf->ctrls.error) {
-		dev_err(vsp1->dev, "wpf%u: failed to initialize controls\n",
-			wpf->entity.index);
+	if (wpf->ctrls.error)
 		return wpf->ctrls.error;
-	}
 
 	return 0;
 }