aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/s3c-camif/camif-regs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/platform/s3c-camif/camif-regs.c')
-rw-r--r--drivers/media/platform/s3c-camif/camif-regs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/platform/s3c-camif/camif-regs.c b/drivers/media/platform/s3c-camif/camif-regs.c
index a9e3b16460b8..ebf5b184cce4 100644
--- a/drivers/media/platform/s3c-camif/camif-regs.c
+++ b/drivers/media/platform/s3c-camif/camif-regs.c
@@ -106,15 +106,15 @@ static const u32 src_pixfmt_map[8][2] = {
106void camif_hw_set_source_format(struct camif_dev *camif) 106void camif_hw_set_source_format(struct camif_dev *camif)
107{ 107{
108 struct v4l2_mbus_framefmt *mf = &camif->mbus_fmt; 108 struct v4l2_mbus_framefmt *mf = &camif->mbus_fmt;
109 unsigned int i = ARRAY_SIZE(src_pixfmt_map); 109 int i;
110 u32 cfg; 110 u32 cfg;
111 111
112 while (i-- >= 0) { 112 for (i = ARRAY_SIZE(src_pixfmt_map) - 1; i >= 0; i--) {
113 if (src_pixfmt_map[i][0] == mf->code) 113 if (src_pixfmt_map[i][0] == mf->code)
114 break; 114 break;
115 } 115 }
116 116 if (i < 0) {
117 if (i == 0 && src_pixfmt_map[i][0] != mf->code) { 117 i = 0;
118 dev_err(camif->dev, 118 dev_err(camif->dev,
119 "Unsupported pixel code, falling back to %#08x\n", 119 "Unsupported pixel code, falling back to %#08x\n",
120 src_pixfmt_map[i][0]); 120 src_pixfmt_map[i][0]);