diff mbox series

[v3,6/9] media: v4l2-subdev: fix v4l2_subdev_get_try_* dependency

Message ID 20180918131453.21031-7-m.felsch@pengutronix.de (mailing list archive)
State New, archived
Headers show
Series TVP5150 fixes and new features | expand

Commit Message

Marco Felsch Sept. 18, 2018, 1:14 p.m. UTC
These helpers make us of the media-controller entity which is only
available if the CONFIG_MEDIA_CONTROLLER is enabled.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
Changelog:

v3:
- add CONFIG_MEDIA_CONTROLLER switch instead of moving the
  v4l2_subdev_get_try_* APIs into the existing one.

v2:
- Initial commit

 include/media/v4l2-subdev.h | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Sakari Ailus Sept. 19, 2018, 10:45 a.m. UTC | #1
Hi Marco,

On Tue, Sep 18, 2018 at 03:14:50PM +0200, Marco Felsch wrote:
> These helpers make us of the media-controller entity which is only
> available if the CONFIG_MEDIA_CONTROLLER is enabled.
> 
> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> ---
> Changelog:
> 
> v3:
> - add CONFIG_MEDIA_CONTROLLER switch instead of moving the
>   v4l2_subdev_get_try_* APIs into the existing one.
> 
> v2:
> - Initial commit
> 
>  include/media/v4l2-subdev.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
> index ce48f1fcf295..d2479d5ebca8 100644
> --- a/include/media/v4l2-subdev.h
> +++ b/include/media/v4l2-subdev.h
> @@ -912,6 +912,8 @@ struct v4l2_subdev_fh {
>  #define to_v4l2_subdev_fh(fh)	\
>  	container_of(fh, struct v4l2_subdev_fh, vfh)
>  
> +#ifdef CONFIG_MEDIA_CONTROLLER

VIDEO_V4L2_SUBDEV_API (used below) depends on MEDIA_CONTROLLER. Either this
or the previous patch would be meaningful but not both.

Considering a driver wouldn't use the functions below if it did not need or
could use VIDEO_V4L2_SUBDEV_API, I'd suggest retaining the other patch.

> +
>  /**
>   * v4l2_subdev_get_try_format - ancillary routine to call
>   *	&struct v4l2_subdev_pad_config->try_fmt
> @@ -978,6 +980,8 @@ static inline struct v4l2_rect
>  #endif
>  }
>  
> +#endif
> +
>  extern const struct v4l2_file_operations v4l2_subdev_fops;
>  
>  /**
Marco Felsch Sept. 19, 2018, 12:37 p.m. UTC | #2
Hi Sakari,

On 18-09-19 13:45, Sakari Ailus wrote:
> Hi Marco,
> 
> On Tue, Sep 18, 2018 at 03:14:50PM +0200, Marco Felsch wrote:
> > These helpers make us of the media-controller entity which is only
> > available if the CONFIG_MEDIA_CONTROLLER is enabled.
> > 
> > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> > ---
> > Changelog:
> > 
> > v3:
> > - add CONFIG_MEDIA_CONTROLLER switch instead of moving the
> >   v4l2_subdev_get_try_* APIs into the existing one.
> > 
> > v2:
> > - Initial commit
> > 
> >  include/media/v4l2-subdev.h | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
> > index ce48f1fcf295..d2479d5ebca8 100644
> > --- a/include/media/v4l2-subdev.h
> > +++ b/include/media/v4l2-subdev.h
> > @@ -912,6 +912,8 @@ struct v4l2_subdev_fh {
> >  #define to_v4l2_subdev_fh(fh)	\
> >  	container_of(fh, struct v4l2_subdev_fh, vfh)
> >  
> > +#ifdef CONFIG_MEDIA_CONTROLLER
> 
> VIDEO_V4L2_SUBDEV_API (used below) depends on MEDIA_CONTROLLER. Either this
> or the previous patch would be meaningful but not both.
> 
> Considering a driver wouldn't use the functions below if it did not need or
> could use VIDEO_V4L2_SUBDEV_API, I'd suggest retaining the other patch.

Oh sorry didn't checked the Kconfig.
Mauro can you drop that patch and use only the patch ("media: v4l2-subdev:
add stubs for v4l2_subdev_get_try_*")?

Regards,
Marco

> > +
> >  /**
> >   * v4l2_subdev_get_try_format - ancillary routine to call
> >   *	&struct v4l2_subdev_pad_config->try_fmt
> > @@ -978,6 +980,8 @@ static inline struct v4l2_rect
> >  #endif
> >  }
> >  
> > +#endif
> > +
> >  extern const struct v4l2_file_operations v4l2_subdev_fops;
> >  
> >  /**
> 
> -- 
> Sakari Ailus
> e-mail: sakari.ailus@iki.fi
>
diff mbox series

Patch

diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index ce48f1fcf295..d2479d5ebca8 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -912,6 +912,8 @@  struct v4l2_subdev_fh {
 #define to_v4l2_subdev_fh(fh)	\
 	container_of(fh, struct v4l2_subdev_fh, vfh)
 
+#ifdef CONFIG_MEDIA_CONTROLLER
+
 /**
  * v4l2_subdev_get_try_format - ancillary routine to call
  *	&struct v4l2_subdev_pad_config->try_fmt
@@ -978,6 +980,8 @@  static inline struct v4l2_rect
 #endif
 }
 
+#endif
+
 extern const struct v4l2_file_operations v4l2_subdev_fops;
 
 /**