aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/media
diff options
context:
space:
mode:
authorEzequiel Garcia <ezequiel@collabora.com>2019-08-15 13:48:05 -0300
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-08-26 10:52:06 -0300
commit51ff392c280733aa9e6bd47b3f5e83e32bfdf16a (patch)
treeb61a41e79f08d1a3a1fe26c0d5946f5faccbfe03 /include/media
parentmedia: v4l2-core: introduce a helper to unregister a spi subdev (diff)
downloadwireguard-linux-51ff392c280733aa9e6bd47b3f5e83e32bfdf16a.tar.xz
wireguard-linux-51ff392c280733aa9e6bd47b3f5e83e32bfdf16a.zip
media: v4l2-core: introduce a helper to unregister a i2c subdev
Introduce a new video4linux2 i2c helper, to unregister a subdev. This allows to get rid of yet another ifdef. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil-cisco@xs4all.nl: fix checkpatch warning] Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/v4l2-common.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index e2878654d043..c070d8ae11e5 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -211,6 +211,13 @@ unsigned short v4l2_i2c_subdev_addr(struct v4l2_subdev *sd);
*/
const unsigned short *v4l2_i2c_tuner_addrs(enum v4l2_i2c_tuner_type type);
+/**
+ * v4l2_i2c_subdev_unregister - Unregister a v4l2_subdev
+ *
+ * @sd: pointer to &struct v4l2_subdev
+ */
+void v4l2_i2c_subdev_unregister(struct v4l2_subdev *sd);
+
#else
static inline struct v4l2_subdev *
@@ -250,6 +257,9 @@ v4l2_i2c_tuner_addrs(enum v4l2_i2c_tuner_type type)
return NULL;
}
+static inline void v4l2_i2c_subdev_unregister(struct v4l2_subdev *sd)
+{}
+
#endif
/* ------------------------------------------------------------------------- */