media: v4l2-flash: Add sanity checks for flash and indicator controls
authorSakari Ailus <sakari.ailus@linux.intel.com>
Thu, 24 Jun 2021 12:05:24 +0000 (14:05 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 4 Aug 2021 12:43:51 +0000 (14:43 +0200)
commita40eba9b26f70c7a967647a05ce0ef84e82140ba
tree574c68b15d50d44612c8b9ee31f96b1a58daa8c6
parent41a95d043fa59e99ce4440c38640576232ef5f74
media: v4l2-flash: Add sanity checks for flash and indicator controls

The V4L2 flash API supports combinations of indicator and flash LEDs. Due
to this, there's a fair amount of code that deals with all the possible
options and just reading one part of the file doesn't really tell which
combinations are really possible.

Make the checks more explicit to keep static analysers happy and to make
the code more resilient to future mishaps.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/v4l2-core/v4l2-flash-led-class.c