summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/soc_camera.c
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@pengutronix.de>2008-03-24 12:18:36 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 14:07:53 -0300
commit26f1b942156766c6ff1a70fb2ac463c6fce31309 (patch)
tree20799de356a6876dabbf1366963f849cb7f2889c /drivers/media/video/soc_camera.c
parent8be38c815e181402c777e033f40971a7be19cf8b (diff)
V4L/DVB (7406): soc-camera: improve separation between soc_camera_ops and soc_camera_device
In case of muliple cameras, handled by the same driver, they can support Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/soc_camera.c')
-rw-r--r--drivers/media/video/soc_camera.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c
index 91e1ab36fe5..4af38d444e0 100644
--- a/drivers/media/video/soc_camera.c
+++ b/drivers/media/video/soc_camera.c
@@ -38,9 +38,9 @@ format_by_fourcc(struct soc_camera_device *icd, unsigned int fourcc)
{
unsigned int i;
- for (i = 0; i < icd->ops->num_formats; i++)
- if (icd->ops->formats[i].fourcc == fourcc)
- return icd->ops->formats + i;
+ for (i = 0; i < icd->num_formats; i++)
+ if (icd->formats[i].fourcc == fourcc)
+ return icd->formats + i;
return NULL;
}
@@ -384,10 +384,10 @@ static int soc_camera_enum_fmt_cap(struct file *file, void *priv,
WARN_ON(priv != file->private_data);
- if (f->index >= icd->ops->num_formats)
+ if (f->index >= icd->num_formats)
return -EINVAL;
- format = &icd->ops->formats[f->index];
+ format = &icd->formats[f->index];
strlcpy(f->description, format->name, sizeof(f->description));
f->pixelformat = format->fourcc;
@@ -701,7 +701,7 @@ static int soc_camera_probe(struct device *dev)
to_soc_camera_host(icd->dev.parent);
int ret;
- if (!icd->probe)
+ if (!icd->ops->probe)
return -ENODEV;
/* We only call ->add() here to activate and probe the camera.
@@ -710,7 +710,7 @@ static int soc_camera_probe(struct device *dev)
if (ret < 0)
return ret;
- ret = icd->probe(icd);
+ ret = icd->ops->probe(icd);
if (ret >= 0) {
const struct v4l2_queryctrl *qctrl;
@@ -731,8 +731,8 @@ static int soc_camera_remove(struct device *dev)
{
struct soc_camera_device *icd = to_soc_camera_dev(dev);
- if (icd->remove)
- icd->remove(icd);
+ if (icd->ops->remove)
+ icd->ops->remove(icd);
return 0;
}
@@ -928,7 +928,7 @@ int soc_camera_video_start(struct soc_camera_device *icd)
vdev->vidioc_s_register = soc_camera_s_register;
#endif
- icd->current_fmt = &icd->ops->formats[0];
+ icd->current_fmt = &icd->formats[0];
err = video_register_device(vdev, VFL_TYPE_GRABBER, vdev->minor);
if (err < 0) {