Hi Mauro, Hans: A new spin of this cleanup series. Goal here is to remove some ifdefs and while at it remove some low hanging fruit. Patch 1 merges v4l2-common.ko into videodev.ko, since it doesn't seem to be useful to have them splitted. Patches 2 to 5 move the I2C and SPI helpers, so they can be conditionally built. Patch 6 removes unneeded BUG() calls in these helpers. Hans, you suggested to replace BUG with WARN_ON, but it seemed that just returning NULL was fine. There are a few checkpatch.pl issues triggered here, all of them belonging to the already existing code. I'm not addressing that in this series. The entire series should not affect any functionality, but just clean-up the code a bit. Thanks, Eze Ezequiel Garcia (6): media: v4l2-core: Module re-organization media: v4l2-core: move spi helpers out of v4l2-common.c media: v4l2-core: move i2c helpers out of v4l2-common.c media: v4l2-core: introduce a helper to unregister a spi subdev media: v4l2-core: introduce a helper to unregister a i2c subdev media: v4l2-core: Remove BUG() from i2c and spi helpers drivers/media/v4l2-core/Kconfig | 5 + drivers/media/v4l2-core/Makefile | 5 +- drivers/media/v4l2-core/v4l2-common.c | 214 -------------------------- drivers/media/v4l2-core/v4l2-dev.c | 4 +- drivers/media/v4l2-core/v4l2-device.c | 39 +---- drivers/media/v4l2-core/v4l2-i2c.c | 168 ++++++++++++++++++++ drivers/media/v4l2-core/v4l2-spi.c | 73 +++++++++ include/media/v4l2-common.h | 150 +++++++++++++----- 8 files changed, 366 insertions(+), 292 deletions(-) create mode 100644 drivers/media/v4l2-core/v4l2-i2c.c create mode 100644 drivers/media/v4l2-core/v4l2-spi.c -- 2.22.0