diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2011-05-18 11:49:54 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-05-20 17:06:46 +0200 |
commit | d2dcad49bc346054b49bd40fd96f397fec695a0f (patch) | |
tree | 2aefcd96625a494c842938daa59c9dbfd6a7f1d6 /drivers/media/video/soc_camera.c | |
parent | [media] V4L: soc-camera: add more format look-up entries (diff) | |
download | linux-d2dcad49bc346054b49bd40fd96f397fec695a0f.tar.xz linux-d2dcad49bc346054b49bd40fd96f397fec695a0f.zip |
[media] V4L: soc-camera: a missing mediabus code -> fourcc translation is not critical
soc_mbus_get_fmtdesc() returning NULL means only, that no standard
mediabus code -> fourcc conversion is known, this shouldn't be treated
as an error by drivers.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/soc_camera.c')
-rw-r--r-- | drivers/media/video/soc_camera.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c index 3fb533c4d334..398864370267 100644 --- a/drivers/media/video/soc_camera.c +++ b/drivers/media/video/soc_camera.c @@ -363,8 +363,6 @@ static int soc_camera_init_user_formats(struct soc_camera_device *icd) if (!icd->user_formats) return -ENOMEM; - icd->num_user_formats = fmts; - dev_dbg(&icd->dev, "Found %d supported formats.\n", fmts); /* Second pass - actually fill data formats */ @@ -372,9 +370,10 @@ static int soc_camera_init_user_formats(struct soc_camera_device *icd) for (i = 0; i < raw_fmts; i++) if (!ici->ops->get_formats) { v4l2_subdev_call(sd, video, enum_mbus_fmt, i, &code); - icd->user_formats[i].host_fmt = + icd->user_formats[fmts].host_fmt = soc_mbus_get_fmtdesc(code); - icd->user_formats[i].code = code; + if (icd->user_formats[fmts].host_fmt) + icd->user_formats[fmts++].code = code; } else { ret = ici->ops->get_formats(icd, i, &icd->user_formats[fmts]); @@ -383,12 +382,12 @@ static int soc_camera_init_user_formats(struct soc_camera_device *icd) fmts += ret; } + icd->num_user_formats = fmts; icd->current_fmt = &icd->user_formats[0]; return 0; egfmt: - icd->num_user_formats = 0; vfree(icd->user_formats); return ret; } |