diff options
author | Guennadi Liakhovetski <g.liakhovetski@pengutronix.de> | 2008-03-24 11:18:36 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:07:53 -0400 |
commit | 26f1b942156766c6ff1a70fb2ac463c6fce31309 (patch) | |
tree | 20799de356a6876dabbf1366963f849cb7f2889c /drivers/media/video/soc_camera.c | |
parent | 8be38c815e181402c777e033f40971a7be19cf8b (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.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c index 91e1ab36fe5d..4af38d444e0c 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) | |||
38 | { | 38 | { |
39 | unsigned int i; | 39 | unsigned int i; |
40 | 40 | ||
41 | for (i = 0; i < icd->ops->num_formats; i++) | 41 | for (i = 0; i < icd->num_formats; i++) |
42 | if (icd->ops->formats[i].fourcc == fourcc) | 42 | if (icd->formats[i].fourcc == fourcc) |
43 | return icd->ops->formats + i; | 43 | return icd->formats + i; |
44 | return NULL; | 44 | return NULL; |
45 | } | 45 | } |
46 | 46 | ||
@@ -384,10 +384,10 @@ static int soc_camera_enum_fmt_cap(struct file *file, void *priv, | |||
384 | 384 | ||
385 | WARN_ON(priv != file->private_data); | 385 | WARN_ON(priv != file->private_data); |
386 | 386 | ||
387 | if (f->index >= icd->ops->num_formats) | 387 | if (f->index >= icd->num_formats) |
388 | return -EINVAL; | 388 | return -EINVAL; |
389 | 389 | ||
390 | format = &icd->ops->formats[f->index]; | 390 | format = &icd->formats[f->index]; |
391 | 391 | ||
392 | strlcpy(f->description, format->name, sizeof(f->description)); | 392 | strlcpy(f->description, format->name, sizeof(f->description)); |
393 | f->pixelformat = format->fourcc; | 393 | f->pixelformat = format->fourcc; |
@@ -701,7 +701,7 @@ static int soc_camera_probe(struct device *dev) | |||
701 | to_soc_camera_host(icd->dev.parent); | 701 | to_soc_camera_host(icd->dev.parent); |
702 | int ret; | 702 | int ret; |
703 | 703 | ||
704 | if (!icd->probe) | 704 | if (!icd->ops->probe) |
705 | return -ENODEV; | 705 | return -ENODEV; |
706 | 706 | ||
707 | /* We only call ->add() here to activate and probe the camera. | 707 | /* We only call ->add() here to activate and probe the camera. |
@@ -710,7 +710,7 @@ static int soc_camera_probe(struct device *dev) | |||
710 | if (ret < 0) | 710 | if (ret < 0) |
711 | return ret; | 711 | return ret; |
712 | 712 | ||
713 | ret = icd->probe(icd); | 713 | ret = icd->ops->probe(icd); |
714 | if (ret >= 0) { | 714 | if (ret >= 0) { |
715 | const struct v4l2_queryctrl *qctrl; | 715 | const struct v4l2_queryctrl *qctrl; |
716 | 716 | ||
@@ -731,8 +731,8 @@ static int soc_camera_remove(struct device *dev) | |||
731 | { | 731 | { |
732 | struct soc_camera_device *icd = to_soc_camera_dev(dev); | 732 | struct soc_camera_device *icd = to_soc_camera_dev(dev); |
733 | 733 | ||
734 | if (icd->remove) | 734 | if (icd->ops->remove) |
735 | icd->remove(icd); | 735 | icd->ops->remove(icd); |
736 | 736 | ||
737 | return 0; | 737 | return 0; |
738 | } | 738 | } |
@@ -928,7 +928,7 @@ int soc_camera_video_start(struct soc_camera_device *icd) | |||
928 | vdev->vidioc_s_register = soc_camera_s_register; | 928 | vdev->vidioc_s_register = soc_camera_s_register; |
929 | #endif | 929 | #endif |
930 | 930 | ||
931 | icd->current_fmt = &icd->ops->formats[0]; | 931 | icd->current_fmt = &icd->formats[0]; |
932 | 932 | ||
933 | err = video_register_device(vdev, VFL_TYPE_GRABBER, vdev->minor); | 933 | err = video_register_device(vdev, VFL_TYPE_GRABBER, vdev->minor); |
934 | if (err < 0) { | 934 | if (err < 0) { |