diff mbox series

[v3,7/8] media: v4l: subdev: Remove stream-unaware sub-device state access

Message ID 20231023174408.803874-8-sakari.ailus@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series Unify sub-device state access functions | expand

Commit Message

Sakari Ailus Oct. 23, 2023, 5:44 p.m. UTC
Remove stream-unaware sub-device state access functions and macros. These
are no longer used.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 include/media/v4l2-subdev.h | 77 -------------------------------------
 1 file changed, 77 deletions(-)

Comments

Laurent Pinchart Oct. 23, 2023, 10:14 p.m. UTC | #1
Hi Sakari,

Thank you for the patch.

On Mon, Oct 23, 2023 at 08:44:07PM +0300, Sakari Ailus wrote:
> Remove stream-unaware sub-device state access functions and macros. These
> are no longer used.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

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

> ---
>  include/media/v4l2-subdev.h | 77 -------------------------------------
>  1 file changed, 77 deletions(-)
> 
> diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
> index 12eb0fe746d7..24a0add93e6e 100644
> --- a/include/media/v4l2-subdev.h
> +++ b/include/media/v4l2-subdev.h
> @@ -1144,83 +1144,6 @@ struct v4l2_subdev_fh {
>  #define to_v4l2_subdev_fh(fh)	\
>  	container_of(fh, struct v4l2_subdev_fh, vfh)
>  
> -#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API)
> -
> -/**
> - * v4l2_subdev_get_pad_format - ancillary routine to call
> - *	&struct v4l2_subdev_pad_config->try_fmt
> - *
> - * @sd: pointer to &struct v4l2_subdev
> - * @state: pointer to &struct v4l2_subdev_state
> - * @pad: index of the pad in the &struct v4l2_subdev_state->pads array
> - */
> -static inline struct v4l2_mbus_framefmt *
> -v4l2_subdev_get_pad_format(struct v4l2_subdev *sd,
> -			   struct v4l2_subdev_state *state,
> -			   unsigned int pad)
> -{
> -	if (WARN_ON(!state))
> -		return NULL;
> -	if (WARN_ON(pad >= sd->entity.num_pads))
> -		pad = 0;
> -	return &state->pads[pad].try_fmt;
> -}
> -
> -/**
> - * v4l2_subdev_get_pad_crop - ancillary routine to call
> - *	&struct v4l2_subdev_pad_config->try_crop
> - *
> - * @sd: pointer to &struct v4l2_subdev
> - * @state: pointer to &struct v4l2_subdev_state.
> - * @pad: index of the pad in the &struct v4l2_subdev_state->pads array.
> - */
> -static inline struct v4l2_rect *
> -v4l2_subdev_get_pad_crop(struct v4l2_subdev *sd,
> -			 struct v4l2_subdev_state *state,
> -			 unsigned int pad)
> -{
> -	if (WARN_ON(!state))
> -		return NULL;
> -	if (WARN_ON(pad >= sd->entity.num_pads))
> -		pad = 0;
> -	return &state->pads[pad].try_crop;
> -}
> -
> -/**
> - * v4l2_subdev_get_pad_compose - ancillary routine to call
> - *	&struct v4l2_subdev_pad_config->try_compose
> - *
> - * @sd: pointer to &struct v4l2_subdev
> - * @state: pointer to &struct v4l2_subdev_state.
> - * @pad: index of the pad in the &struct v4l2_subdev_state->pads array.
> - */
> -static inline struct v4l2_rect *
> -v4l2_subdev_get_pad_compose(struct v4l2_subdev *sd,
> -			    struct v4l2_subdev_state *state,
> -			    unsigned int pad)
> -{
> -	if (WARN_ON(!state))
> -		return NULL;
> -	if (WARN_ON(pad >= sd->entity.num_pads))
> -		pad = 0;
> -	return &state->pads[pad].try_compose;
> -}
> -
> -/*
> - * Temprary helpers until uses of v4l2_subdev_get_try_* functions have been
> - * renamed
> - */
> -#define v4l2_subdev_get_try_format(sd, state, pad) \
> -	v4l2_subdev_get_pad_format(sd, state, pad)
> -
> -#define v4l2_subdev_get_try_crop(sd, state, pad) \
> -	v4l2_subdev_get_pad_crop(sd, state, pad)
> -
> -#define v4l2_subdev_get_try_compose(sd, state, pad) \
> -	v4l2_subdev_get_pad_compose(sd, state, pad)
> -
> -#endif /* CONFIG_VIDEO_V4L2_SUBDEV_API */
> -
>  extern const struct v4l2_file_operations v4l2_subdev_fops;
>  
>  /**
diff mbox series

Patch

diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 12eb0fe746d7..24a0add93e6e 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -1144,83 +1144,6 @@  struct v4l2_subdev_fh {
 #define to_v4l2_subdev_fh(fh)	\
 	container_of(fh, struct v4l2_subdev_fh, vfh)
 
-#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API)
-
-/**
- * v4l2_subdev_get_pad_format - ancillary routine to call
- *	&struct v4l2_subdev_pad_config->try_fmt
- *
- * @sd: pointer to &struct v4l2_subdev
- * @state: pointer to &struct v4l2_subdev_state
- * @pad: index of the pad in the &struct v4l2_subdev_state->pads array
- */
-static inline struct v4l2_mbus_framefmt *
-v4l2_subdev_get_pad_format(struct v4l2_subdev *sd,
-			   struct v4l2_subdev_state *state,
-			   unsigned int pad)
-{
-	if (WARN_ON(!state))
-		return NULL;
-	if (WARN_ON(pad >= sd->entity.num_pads))
-		pad = 0;
-	return &state->pads[pad].try_fmt;
-}
-
-/**
- * v4l2_subdev_get_pad_crop - ancillary routine to call
- *	&struct v4l2_subdev_pad_config->try_crop
- *
- * @sd: pointer to &struct v4l2_subdev
- * @state: pointer to &struct v4l2_subdev_state.
- * @pad: index of the pad in the &struct v4l2_subdev_state->pads array.
- */
-static inline struct v4l2_rect *
-v4l2_subdev_get_pad_crop(struct v4l2_subdev *sd,
-			 struct v4l2_subdev_state *state,
-			 unsigned int pad)
-{
-	if (WARN_ON(!state))
-		return NULL;
-	if (WARN_ON(pad >= sd->entity.num_pads))
-		pad = 0;
-	return &state->pads[pad].try_crop;
-}
-
-/**
- * v4l2_subdev_get_pad_compose - ancillary routine to call
- *	&struct v4l2_subdev_pad_config->try_compose
- *
- * @sd: pointer to &struct v4l2_subdev
- * @state: pointer to &struct v4l2_subdev_state.
- * @pad: index of the pad in the &struct v4l2_subdev_state->pads array.
- */
-static inline struct v4l2_rect *
-v4l2_subdev_get_pad_compose(struct v4l2_subdev *sd,
-			    struct v4l2_subdev_state *state,
-			    unsigned int pad)
-{
-	if (WARN_ON(!state))
-		return NULL;
-	if (WARN_ON(pad >= sd->entity.num_pads))
-		pad = 0;
-	return &state->pads[pad].try_compose;
-}
-
-/*
- * Temprary helpers until uses of v4l2_subdev_get_try_* functions have been
- * renamed
- */
-#define v4l2_subdev_get_try_format(sd, state, pad) \
-	v4l2_subdev_get_pad_format(sd, state, pad)
-
-#define v4l2_subdev_get_try_crop(sd, state, pad) \
-	v4l2_subdev_get_pad_crop(sd, state, pad)
-
-#define v4l2_subdev_get_try_compose(sd, state, pad) \
-	v4l2_subdev_get_pad_compose(sd, state, pad)
-
-#endif /* CONFIG_VIDEO_V4L2_SUBDEV_API */
-
 extern const struct v4l2_file_operations v4l2_subdev_fops;
 
 /**