diff mbox series

[v2,13/13] media: i2c: imx290: Add the error code to logs in start_streaming

Message ID 20230203191811.947697-14-dave.stevenson@raspberrypi.com
State Accepted
Commit a3d4bba7dcabdc8b5ebeb77e5ffc7e51082f3193
Headers show
Series imx290: Minor fixes, support for alternate INCK, and more ctrls | expand

Commit Message

Dave Stevenson Feb. 3, 2023, 7:18 p.m. UTC
imx290_start_streaming logs what failed, but not the error
code from that function. Add it into the log message.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
 drivers/media/i2c/imx290.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Laurent Pinchart Feb. 7, 2023, 1:53 a.m. UTC | #1
Hi Dave,

Thank you for the patch.

On Fri, Feb 03, 2023 at 07:18:11PM +0000, Dave Stevenson wrote:
> imx290_start_streaming logs what failed, but not the error
> code from that function. Add it into the log message.
> 
> Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>

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

> ---
>  drivers/media/i2c/imx290.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c
> index 7167eb1edb9b..f635f1213477 100644
> --- a/drivers/media/i2c/imx290.c
> +++ b/drivers/media/i2c/imx290.c
> @@ -1007,20 +1007,20 @@ static int imx290_start_streaming(struct imx290 *imx290,
>  	/* Set clock parameters based on mode and xclk */
>  	ret = imx290_set_clock(imx290);
>  	if (ret < 0) {
> -		dev_err(imx290->dev, "Could not set clocks\n");
> +		dev_err(imx290->dev, "Could not set clocks - %d\n", ret);
>  		return ret;
>  	}
>  
>  	/* Set data lane count */
>  	ret = imx290_set_data_lanes(imx290);
>  	if (ret < 0) {
> -		dev_err(imx290->dev, "Could not set data lanes\n");
> +		dev_err(imx290->dev, "Could not set data lanes - %d\n", ret);
>  		return ret;
>  	}
>  
>  	ret = imx290_set_csi_config(imx290);
>  	if (ret < 0) {
> -		dev_err(imx290->dev, "Could not set csi cfg\n");
> +		dev_err(imx290->dev, "Could not set csi cfg - %d\n", ret);
>  		return ret;
>  	}
>  
> @@ -1028,7 +1028,7 @@ static int imx290_start_streaming(struct imx290 *imx290,
>  	format = v4l2_subdev_get_pad_format(&imx290->sd, state, 0);
>  	ret = imx290_setup_format(imx290, format);
>  	if (ret < 0) {
> -		dev_err(imx290->dev, "Could not set frame format\n");
> +		dev_err(imx290->dev, "Could not set frame format - %d\n", ret);
>  		return ret;
>  	}
>  
> @@ -1036,14 +1036,14 @@ static int imx290_start_streaming(struct imx290 *imx290,
>  	ret = imx290_set_register_array(imx290, imx290->current_mode->data,
>  					imx290->current_mode->data_size);
>  	if (ret < 0) {
> -		dev_err(imx290->dev, "Could not set current mode\n");
> +		dev_err(imx290->dev, "Could not set current mode - %d\n", ret);
>  		return ret;
>  	}
>  
>  	/* Apply customized values from user */
>  	ret = __v4l2_ctrl_handler_setup(imx290->sd.ctrl_handler);
>  	if (ret) {
> -		dev_err(imx290->dev, "Could not sync v4l2 controls\n");
> +		dev_err(imx290->dev, "Could not sync v4l2 controls - %d\n", ret);
>  		return ret;
>  	}
>
diff mbox series

Patch

diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c
index 7167eb1edb9b..f635f1213477 100644
--- a/drivers/media/i2c/imx290.c
+++ b/drivers/media/i2c/imx290.c
@@ -1007,20 +1007,20 @@  static int imx290_start_streaming(struct imx290 *imx290,
 	/* Set clock parameters based on mode and xclk */
 	ret = imx290_set_clock(imx290);
 	if (ret < 0) {
-		dev_err(imx290->dev, "Could not set clocks\n");
+		dev_err(imx290->dev, "Could not set clocks - %d\n", ret);
 		return ret;
 	}
 
 	/* Set data lane count */
 	ret = imx290_set_data_lanes(imx290);
 	if (ret < 0) {
-		dev_err(imx290->dev, "Could not set data lanes\n");
+		dev_err(imx290->dev, "Could not set data lanes - %d\n", ret);
 		return ret;
 	}
 
 	ret = imx290_set_csi_config(imx290);
 	if (ret < 0) {
-		dev_err(imx290->dev, "Could not set csi cfg\n");
+		dev_err(imx290->dev, "Could not set csi cfg - %d\n", ret);
 		return ret;
 	}
 
@@ -1028,7 +1028,7 @@  static int imx290_start_streaming(struct imx290 *imx290,
 	format = v4l2_subdev_get_pad_format(&imx290->sd, state, 0);
 	ret = imx290_setup_format(imx290, format);
 	if (ret < 0) {
-		dev_err(imx290->dev, "Could not set frame format\n");
+		dev_err(imx290->dev, "Could not set frame format - %d\n", ret);
 		return ret;
 	}
 
@@ -1036,14 +1036,14 @@  static int imx290_start_streaming(struct imx290 *imx290,
 	ret = imx290_set_register_array(imx290, imx290->current_mode->data,
 					imx290->current_mode->data_size);
 	if (ret < 0) {
-		dev_err(imx290->dev, "Could not set current mode\n");
+		dev_err(imx290->dev, "Could not set current mode - %d\n", ret);
 		return ret;
 	}
 
 	/* Apply customized values from user */
 	ret = __v4l2_ctrl_handler_setup(imx290->sd.ctrl_handler);
 	if (ret) {
-		dev_err(imx290->dev, "Could not sync v4l2 controls\n");
+		dev_err(imx290->dev, "Could not sync v4l2 controls - %d\n", ret);
 		return ret;
 	}