[PATCH v2 04/12] media: imx-mipi-csis: Shorten name of subdev state variables

Frank Li Frank.li at nxp.com
Thu Aug 21 08:17:29 PDT 2025


On Thu, Aug 21, 2025 at 03:09:36AM +0300, Laurent Pinchart wrote:
> Rename subdev state parameters passed to subdev operations from sd_state
> to state. This standardizes the naming of the subdev state variables
> through the driver, and helps shortening lines.

Nit: I like simple sentence.

Rename sd_state to state to standardize the naming of the subdev state
variables and help shortening lines.

Reviewed-by: Frank Li <Frank.Li at nxp.com>

Frank

>
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
>  drivers/media/platform/nxp/imx-mipi-csis.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/media/platform/nxp/imx-mipi-csis.c b/drivers/media/platform/nxp/imx-mipi-csis.c
> index 0f0863011230..894d12fef519 100644
> --- a/drivers/media/platform/nxp/imx-mipi-csis.c
> +++ b/drivers/media/platform/nxp/imx-mipi-csis.c
> @@ -996,7 +996,7 @@ static int mipi_csis_s_stream(struct v4l2_subdev *sd, int enable)
>  }
>
>  static int mipi_csis_enum_mbus_code(struct v4l2_subdev *sd,
> -				    struct v4l2_subdev_state *sd_state,
> +				    struct v4l2_subdev_state *state,
>  				    struct v4l2_subdev_mbus_code_enum *code)
>  {
>  	/*
> @@ -1009,7 +1009,7 @@ static int mipi_csis_enum_mbus_code(struct v4l2_subdev *sd,
>  		if (code->index > 0)
>  			return -EINVAL;
>
> -		fmt = v4l2_subdev_state_get_format(sd_state, code->pad);
> +		fmt = v4l2_subdev_state_get_format(state, code->pad);
>  		code->code = fmt->code;
>  		return 0;
>  	}
> @@ -1026,7 +1026,7 @@ static int mipi_csis_enum_mbus_code(struct v4l2_subdev *sd,
>  }
>
>  static int mipi_csis_set_fmt(struct v4l2_subdev *sd,
> -			     struct v4l2_subdev_state *sd_state,
> +			     struct v4l2_subdev_state *state,
>  			     struct v4l2_subdev_format *sdformat)
>  {
>  	const struct csis_pix_format *csis_fmt;
> @@ -1038,7 +1038,7 @@ static int mipi_csis_set_fmt(struct v4l2_subdev *sd,
>  	 * modified.
>  	 */
>  	if (sdformat->pad == CSIS_PAD_SOURCE)
> -		return v4l2_subdev_get_fmt(sd, sd_state, sdformat);
> +		return v4l2_subdev_get_fmt(sd, state, sdformat);
>
>  	if (sdformat->pad != CSIS_PAD_SINK)
>  		return -EINVAL;
> @@ -1076,7 +1076,7 @@ static int mipi_csis_set_fmt(struct v4l2_subdev *sd,
>  			      &sdformat->format.height, 1,
>  			      CSIS_MAX_PIX_HEIGHT, 0, 0);
>
> -	fmt = v4l2_subdev_state_get_format(sd_state, sdformat->pad);
> +	fmt = v4l2_subdev_state_get_format(state, sdformat->pad);
>
>  	fmt->code = csis_fmt->code;
>  	fmt->width = sdformat->format.width;
> @@ -1090,7 +1090,7 @@ static int mipi_csis_set_fmt(struct v4l2_subdev *sd,
>  	sdformat->format = *fmt;
>
>  	/* Propagate the format from sink to source. */
> -	fmt = v4l2_subdev_state_get_format(sd_state, CSIS_PAD_SOURCE);
> +	fmt = v4l2_subdev_state_get_format(state, CSIS_PAD_SOURCE);
>  	*fmt = sdformat->format;
>
>  	/* The format on the source pad might change due to unpacking. */
> @@ -1130,7 +1130,7 @@ static int mipi_csis_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad,
>  }
>
>  static int mipi_csis_init_state(struct v4l2_subdev *sd,
> -				struct v4l2_subdev_state *sd_state)
> +				struct v4l2_subdev_state *state)
>  {
>  	struct v4l2_subdev_format fmt = {
>  		.pad = CSIS_PAD_SINK,
> @@ -1147,7 +1147,7 @@ static int mipi_csis_init_state(struct v4l2_subdev *sd,
>  		V4L2_MAP_QUANTIZATION_DEFAULT(false, fmt.format.colorspace,
>  					      fmt.format.ycbcr_enc);
>
> -	return mipi_csis_set_fmt(sd, sd_state, &fmt);
> +	return mipi_csis_set_fmt(sd, state, &fmt);
>  }
>
>  static int mipi_csis_log_status(struct v4l2_subdev *sd)
> --
> Regards,
>
> Laurent Pinchart
>



More information about the linux-arm-kernel mailing list