Skip to content

V4L2 core I2C/SPI code cleanup

Ezequiel Garcia linux-media 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 0 repliesNew
  2. v16 patches 5 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6media: v4l2-core: Module re-organizationdrivers/media/v4l2-core/Makefile drivers/media/v4l2-core/v4l2-common.c drivers/media/v4l2-core/v4l2-dev.c+3 -80 replies
2/6media: v4l2-core: move spi helpers out of v4l2-common.cdrivers/media/v4l2-core/Makefile drivers/media/v4l2-core/v4l2-common.c drivers/media/v4l2-core/v4l2-spi.c +1 more+82 -670 replies
3/6media: v4l2-core: move i2c helpers out of v4l2-common.cdrivers/media/v4l2-core/Kconfig drivers/media/v4l2-core/Makefile drivers/media/v4l2-core/v4l2-common.c +2 more+229 -1820 replies
4/6media: v4l2-core: introduce a helper to unregister a spi subdevdrivers/media/v4l2-core/v4l2-device.c drivers/media/v4l2-core/v4l2-spi.c include/media/v4l2-common.h+19 -120 replies
5/6media: v4l2-core: introduce a helper to unregister a i2c subdevdrivers/media/v4l2-core/v4l2-device.c drivers/media/v4l2-core/v4l2-i2c.c include/media/v4l2-common.h+32 -230 replies
6/6media: v4l2-core: Remove BUG() from i2c and spi helpersdrivers/media/v4l2-core/v4l2-i2c.c drivers/media/v4l2-core/v4l2-spi.c+4 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/6] V4L2 core I2C/SPI code cleanup

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
Signature · 1 line
2.22.0