summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Felsch <m.felsch@pengutronix.de>2018-08-08 14:27:46 +0200
committerMarco Felsch <m.felsch@pengutronix.de>2019-04-03 12:10:20 +0200
commita9c9f301eb7794abe625b446283e975ea64d1287 (patch)
tree3ce9f3dd48c7645b51df3c16eefd007783aa02ad
parent9e98c678c2d6ae3a17cb2de55d17f69dddaa231b (diff)
downloadlinux-0-day-a9c9f301eb7794abe625b446283e975ea64d1287.tar.gz
linux-0-day-a9c9f301eb7794abe625b446283e975ea64d1287.tar.xz
media: v4l2-subdev: add stubs for v4l2_subdev_get_try_*
In case of missing CONFIG_VIDEO_V4L2_SUBDEV_API those helpers aren't available. So each driver have to add ifdefs around those helpers or add the CONFIG_VIDEO_V4L2_SUBDEV_API as dependcy. Make these helpers available in case of CONFIG_VIDEO_V4L2_SUBDEV_API isn't set to avoid ifdefs. This approach is less error prone too. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> --- The patch was previously part of series [1]. Since I want to get series [1] merged in 5.2 I split this possible stopper out of the serie and prepared a own series for it. I applied Jacopos comments and switched to Lubomir's approach [2]. During discussion on series [2] Sakari pointed out Hans approach [3] which didn't got into the kernel due to Mauro's concerns. So I think this would be the smalles common dennominator. [1] https://patchwork.kernel.org/cover/10786553/ [2] https://patchwork.kernel.org/patch/10703029/ [3] https://patchwork.linuxtv.org/patch/53370/
-rw-r--r--include/media/v4l2-subdev.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 349e1c18cf48e..5ced5980d352f 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -971,7 +971,34 @@ static inline struct v4l2_rect
pad = 0;
return &cfg[pad].try_compose;
}
-#endif
+
+#else /* !defined(CONFIG_VIDEO_V4L2_SUBDEV_API) */
+
+static inline struct v4l2_mbus_framefmt
+*v4l2_subdev_get_try_format(struct v4l2_subdev *sd,
+ struct v4l2_subdev_pad_config *cfg,
+ unsigned int pad)
+{
+ return ERR_PTR(-ENOTTY);
+}
+
+static inline struct v4l2_rect
+*v4l2_subdev_get_try_crop(struct v4l2_subdev *sd,
+ struct v4l2_subdev_pad_config *cfg,
+ unsigned int pad)
+{
+ return ERR_PTR(-ENOTTY);
+}
+
+static inline struct v4l2_rect
+*v4l2_subdev_get_try_compose(struct v4l2_subdev *sd,
+ struct v4l2_subdev_pad_config *cfg,
+ unsigned int pad)
+{
+ return ERR_PTR(-ENOTTY);
+}
+
+#endif /* defined(CONFIG_VIDEO_V4L2_SUBDEV_API) */
extern const struct v4l2_file_operations v4l2_subdev_fops;