From 7c795df5f344482c2ab8c52ebc1d94302d2b9082 Mon Sep 17 00:00:00 2001 From: Ezequiel Garcia Date: Thu, 15 Aug 2019 13:48:02 -0300 Subject: media: v4l2-core: move spi helpers out of v4l2-common.c Separate the spi helpers to v4l2-spi.c, in order to get rid of the ifdefery. No functional changes intended, this is just a cosmetic change to organize the code better. Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-common.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'include/media/v4l2-common.h') diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index 6b319d0d73ad..a1c5288caa6a 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h @@ -216,11 +216,10 @@ const unsigned short *v4l2_i2c_tuner_addrs(enum v4l2_i2c_tuner_type type); /* ------------------------------------------------------------------------- */ /* SPI Helper functions */ -#if defined(CONFIG_SPI) #include -struct spi_device; +#if defined(CONFIG_SPI) /** * v4l2_spi_new_subdev - Load an spi module and return an initialized @@ -246,6 +245,21 @@ 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); + +#else + +static inline struct v4l2_subdev * +v4l2_spi_new_subdev(struct v4l2_device *v4l2_dev, + struct spi_master *master, struct spi_board_info *info) +{ + return NULL; +} + +static inline void +v4l2_spi_subdev_init(struct v4l2_subdev *sd, struct spi_device *spi, + const struct v4l2_subdev_ops *ops) +{} + #endif /* ------------------------------------------------------------------------- */ -- cgit v1.2.3-59-g8ed1b