diff options
author | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2012-07-24 15:06:26 (GMT) |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-07-30 22:23:17 (GMT) |
commit | 31ce54f6aeb70ecf1b8e758236955dfad1b1e398 (patch) | |
tree | 72a99d2b1c22ac28d9fb813c722398a59b734674 /drivers | |
parent | a516d08fa6afb703ba508ccc55656d037c5b9e2e (diff) | |
download | linux-31ce54f6aeb70ecf1b8e758236955dfad1b1e398.tar.xz |
[media] s5p-fimc: Use switch statement for better readability
Use switch statement rather than multiple 'else if'.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/s5p-fimc/fimc-reg.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/media/video/s5p-fimc/fimc-reg.c b/drivers/media/video/s5p-fimc/fimc-reg.c index 74a2fba..0e3eb9c 100644 --- a/drivers/media/video/s5p-fimc/fimc-reg.c +++ b/drivers/media/video/s5p-fimc/fimc-reg.c @@ -667,7 +667,8 @@ int fimc_hw_set_camera_type(struct fimc_dev *fimc, FIMC_REG_CIGCTRL_SELCAM_MIPI | FIMC_REG_CIGCTRL_CAMIF_SELWB | FIMC_REG_CIGCTRL_SELCAM_MIPI_A | FIMC_REG_CIGCTRL_CAM_JPEG); - if (cam->bus_type == FIMC_MIPI_CSI2) { + switch (cam->bus_type) { + case FIMC_MIPI_CSI2: cfg |= FIMC_REG_CIGCTRL_SELCAM_MIPI; if (cam->mux_id == 0) @@ -691,14 +692,15 @@ int fimc_hw_set_camera_type(struct fimc_dev *fimc, tmp |= (csis_data_alignment == 32) << 8; writel(tmp, fimc->regs + FIMC_REG_CSIIMGFMT); - - } else if (cam->bus_type == FIMC_ITU_601 || - cam->bus_type == FIMC_ITU_656) { + break; + case FIMC_ITU_601...FIMC_ITU_656: if (cam->mux_id == 0) /* ITU-A, ITU-B: 0, 1 */ cfg |= FIMC_REG_CIGCTRL_SELCAM_ITU_A; - } else if (cam->bus_type == FIMC_LCD_WB) { + break; + case FIMC_LCD_WB: cfg |= FIMC_REG_CIGCTRL_CAMIF_SELWB; - } else { + break; + default: v4l2_err(vid_cap->vfd, "Invalid camera bus type selected\n"); return -EINVAL; } |