From 51ff392c280733aa9e6bd47b3f5e83e32bfdf16a Mon Sep 17 00:00:00 2001 From: Ezequiel Garcia Date: Thu, 15 Aug 2019 13:48:05 -0300 Subject: 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 Signed-off-by: Hans Verkuil [hverkuil-cisco@xs4all.nl: fix checkpatch warning] Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-common.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/media/v4l2-common.h') 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 /* ------------------------------------------------------------------------- */ -- cgit