All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [media]: Fix compilation when CONFIG_VIDEO_V4L2_SUBDEV_API is not set
@ 2015-07-16 23:20 Adam Majer
  2015-07-17  1:58 ` Adam Majer
  0 siblings, 1 reply; 2+ messages in thread
From: Adam Majer @ 2015-07-16 23:20 UTC (permalink / raw)
  To: linux-media, Hans Verkuil; +Cc: Adam Majer

When CONFIG_VIDEO_V4L2_SUBDEV_API is unset, some drivers fail to
compile as they use unavailable API.

  drivers/media/i2c/adv7511.c:968:3: error: implicit declaration of
  function ‘v4l2_subdev_get_try_format’
  [-Werror=implicit-function-declaration]
---
 drivers/media/i2c/adv7511.c | 8 ++++++++
 drivers/media/i2c/adv7604.c | 8 ++++++++
 drivers/media/i2c/adv7842.c | 8 ++++++++
 3 files changed, 24 insertions(+)

diff --git a/drivers/media/i2c/adv7511.c b/drivers/media/i2c/adv7511.c
index 95bcd40..e3f5ecb 100644
--- a/drivers/media/i2c/adv7511.c
+++ b/drivers/media/i2c/adv7511.c
@@ -963,6 +963,7 @@ static int adv7511_get_fmt(struct v4l2_subdev *sd,
 	adv7511_fill_format(state, &format->format);
 
 	if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
+#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API)
 		struct v4l2_mbus_framefmt *fmt;
 
 		fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad);
@@ -971,6 +972,9 @@ static int adv7511_get_fmt(struct v4l2_subdev *sd,
 		format->format.ycbcr_enc = fmt->ycbcr_enc;
 		format->format.quantization = fmt->quantization;
 		format->format.xfer_func = fmt->xfer_func;
+#else
+		return -ENOTTY;
+#endif
 	} else {
 		format->format.code = state->fmt_code;
 		format->format.colorspace = state->colorspace;
@@ -1016,6 +1020,7 @@ static int adv7511_set_fmt(struct v4l2_subdev *sd,
 
 	adv7511_fill_format(state, &format->format);
 	if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
+#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API)
 		struct v4l2_mbus_framefmt *fmt;
 
 		fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad);
@@ -1025,6 +1030,9 @@ static int adv7511_set_fmt(struct v4l2_subdev *sd,
 		fmt->quantization = format->format.quantization;
 		fmt->xfer_func = format->format.xfer_func;
 		return 0;
+#else
+		return -ENOTTY;
+#endif
 	}
 
 	switch (format->format.code) {
diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
index 808360f..c080bca 100644
--- a/drivers/media/i2c/adv7604.c
+++ b/drivers/media/i2c/adv7604.c
@@ -1856,10 +1856,14 @@ static int adv76xx_get_format(struct v4l2_subdev *sd,
 	adv76xx_fill_format(state, &format->format);
 
 	if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
+#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API)
 		struct v4l2_mbus_framefmt *fmt;
 
 		fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad);
 		format->format.code = fmt->code;
+#else
+		return -ENOTTY;
+#endif
 	} else {
 		format->format.code = state->format->code;
 	}
@@ -1885,10 +1889,14 @@ static int adv76xx_set_format(struct v4l2_subdev *sd,
 	format->format.code = info->code;
 
 	if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
+#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API)
 		struct v4l2_mbus_framefmt *fmt;
 
 		fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad);
 		fmt->code = format->format.code;
+#else
+		return -ENOTTY;
+#endif
 	} else {
 		state->format = info;
 		adv76xx_setup_format(state);
diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c
index 4cf79b2..5e50b85 100644
--- a/drivers/media/i2c/adv7842.c
+++ b/drivers/media/i2c/adv7842.c
@@ -2088,10 +2088,14 @@ static int adv7842_get_format(struct v4l2_subdev *sd,
 	adv7842_fill_format(state, &format->format);
 
 	if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
+#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API)
 		struct v4l2_mbus_framefmt *fmt;
 
 		fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad);
 		format->format.code = fmt->code;
+#else
+		return -ENOTTY;
+#endif
 	} else {
 		format->format.code = state->format->code;
 	}
@@ -2120,10 +2124,14 @@ static int adv7842_set_format(struct v4l2_subdev *sd,
 	format->format.code = info->code;
 
 	if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
+#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API)
 		struct v4l2_mbus_framefmt *fmt;
 
 		fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad);
 		fmt->code = format->format.code;
+#else
+		return -ENOTTY;
+#endif
 	} else {
 		state->format = info;
 		adv7842_setup_format(state);
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] [media]: Fix compilation when CONFIG_VIDEO_V4L2_SUBDEV_API is not set
  2015-07-16 23:20 [PATCH] [media]: Fix compilation when CONFIG_VIDEO_V4L2_SUBDEV_API is not set Adam Majer
@ 2015-07-17  1:58 ` Adam Majer
  0 siblings, 0 replies; 2+ messages in thread
From: Adam Majer @ 2015-07-17  1:58 UTC (permalink / raw)
  To: linux-media, Hans Verkuil

On Thu, Jul 16, 2015 at 06:20:55PM -0500, Adam Majer wrote:
> When CONFIG_VIDEO_V4L2_SUBDEV_API is unset, some drivers fail to
> compile as they use unavailable API.
> 
>   drivers/media/i2c/adv7511.c:968:3: error: implicit declaration of
>   function ‘v4l2_subdev_get_try_format’
>   [-Werror=implicit-function-declaration]


oops, maybe this is unnecessary. Seems I had CONFIG_COBALT set which
was causing problems.

warning: (VIDEO_COBALT) selects VIDEO_ADV7511 which has unmet direct
dependencies (MEDIA_SUPPORT && VIDEO_V4L2 && I2C &&
VIDEO_V4L2_SUBDEV_API)
....

so please ignore.

- Adam


-- 
Adam Majer
adamm@zombino.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-17  2:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-16 23:20 [PATCH] [media]: Fix compilation when CONFIG_VIDEO_V4L2_SUBDEV_API is not set Adam Majer
2015-07-17  1:58 ` Adam Majer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.