aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorEzequiel Garcia <ezequiel@collabora.com>2019-08-15 13:48:04 -0300
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-08-26 10:51:29 -0300
commita9cff393c1d78ecbbc33e6196e79bb05ccb4a709 (patch)
treed20d7cc9972f62596c3c44a851bcf398ecec862a /include/media
parentmedia: v4l2-core: move i2c helpers out of v4l2-common.c (diff)
downloadlinux-dev-a9cff393c1d78ecbbc33e6196e79bb05ccb4a709.tar.xz
linux-dev-a9cff393c1d78ecbbc33e6196e79bb05ccb4a709.zip
media: v4l2-core: introduce a helper to unregister a spi subdev
Introduce a new video4linux2 spi helper, to unregister a subdev. This allows to get rid of some more ifdefs. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/v4l2-common.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index 8e66edddd37b..e2878654d043 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -285,6 +285,13 @@ struct v4l2_subdev *v4l2_spi_new_subdev(struct v4l2_device *v4l2_dev,
void v4l2_spi_subdev_init(struct v4l2_subdev *sd, struct spi_device *spi,
const struct v4l2_subdev_ops *ops);
+/**
+ * v4l2_spi_subdev_unregister - Unregister a v4l2_subdev
+ *
+ * @sd: pointer to &struct v4l2_subdev
+ */
+void v4l2_spi_subdev_unregister(struct v4l2_subdev *sd);
+
#else
static inline struct v4l2_subdev *
@@ -299,6 +306,8 @@ v4l2_spi_subdev_init(struct v4l2_subdev *sd, struct spi_device *spi,
const struct v4l2_subdev_ops *ops)
{}
+static inline void v4l2_spi_subdev_unregister(struct v4l2_subdev *sd)
+{}
#endif
/* ------------------------------------------------------------------------- */