summaryrefslogtreecommitdiffstats
path: root/drivers/media/test-drivers/vimc/vimc-core.c
diff options
context:
space:
mode:
authorDaniel Oakley <daniel.oakley@ideasonboard.com>2022-06-16 11:07:47 +0100
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-07-15 14:43:55 +0100
commitee8dadd7704810f4319d0b469c59e6812ef0115f (patch)
tree3fcfad3a39c2c6739c2bba441f2290e6799b682d /drivers/media/test-drivers/vimc/vimc-core.c
parentf2e761fdace257dd0411958efedb0e7af043c4f8 (diff)
downloadlinux-ee8dadd7704810f4319d0b469c59e6812ef0115f.tar.bz2
media: vimc: use data link entities enum to index the ent_config array
Future additions to the ent_config[] could break the association between the index of the struct vimc_ent_config entries in the ent_config[] array, and the index defined by the enum proposed in the previous patch. Using designated initializers solves this by linking the 2 together clearly in code and prevents the array not reflecting the enum. There is no functional change intended. Suggested-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Daniel Oakley <daniel.oakley@ideasonboard.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/test-drivers/vimc/vimc-core.c')
-rw-r--r--drivers/media/test-drivers/vimc/vimc-core.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/media/test-drivers/vimc/vimc-core.c b/drivers/media/test-drivers/vimc/vimc-core.c
index f3437d4408ff..c73f91947f44 100644
--- a/drivers/media/test-drivers/vimc/vimc-core.c
+++ b/drivers/media/test-drivers/vimc/vimc-core.c
@@ -82,48 +82,48 @@ struct vimc_pipeline_config {
*/
static struct vimc_ent_config ent_config[] = {
- {
+ [SENSOR_A] = {
.name = "Sensor A",
.type = &vimc_sensor_type
},
- {
+ [SENSOR_B] = {
.name = "Sensor B",
.type = &vimc_sensor_type
},
- {
+ [DEBAYER_A] = {
.name = "Debayer A",
.type = &vimc_debayer_type
},
- {
+ [DEBAYER_B] = {
.name = "Debayer B",
.type = &vimc_debayer_type
},
- {
+ [RAW_CAPTURE_0] = {
.name = "Raw Capture 0",
.type = &vimc_capture_type
},
- {
+ [RAW_CAPTURE_1] = {
.name = "Raw Capture 1",
.type = &vimc_capture_type
},
- {
+ [RGB_YUV_INPUT] = {
/* TODO: change this to vimc-input when it is implemented */
.name = "RGB/YUV Input",
.type = &vimc_sensor_type
},
- {
+ [SCALER] = {
.name = "Scaler",
.type = &vimc_scaler_type
},
- {
+ [RGB_YUV_CAPTURE] = {
.name = "RGB/YUV Capture",
.type = &vimc_capture_type
},
- {
+ [LENS_A] = {
.name = "Lens A",
.type = &vimc_lens_type
},
- {
+ [LENS_B] = {
.name = "Lens B",
.type = &vimc_lens_type
},