summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <lyakh@axis700.grange>2008-12-01 13:44:53 +0100
committerGuennadi Liakhovetski <lyakh@axis700.grange>2008-12-01 13:44:53 +0100
commit0b36e297630eb11d129e39d264704119ef3e5bb6 (patch)
tree4a50a9b977037cab6511aa12d2945ed63c4989e4 /linux/drivers
parent64934a93ee0c4f6edf946a0c044ee7a0ec871a0c (diff)
downloadmediapointer-dvb-s2-0b36e297630eb11d129e39d264704119ef3e5bb6.tar.gz
mediapointer-dvb-s2-0b36e297630eb11d129e39d264704119ef3e5bb6.tar.bz2
soc-camera: merge .try_bus_param() into .try_fmt_cap()
.try_bus_param() method from struct soc_camera_host_ops is only called at one location immediately before .try_fmt_cap(), there is no value in keeping these two methods separate, merge them. Signed-off-by: Guennadi Liakhovetski <lg@denx.de> --- drivers/media/video/pxa_camera.c | 6 +++++- drivers/media/video/sh_mobile_ceu_camera.c | 6 +++++- drivers/media/video/soc_camera.c | 5 ----- include/media/soc_camera.h | 1 - 4 files changed, 10 insertions(+), 8 deletions(-)
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/video/pxa_camera.c6
-rw-r--r--linux/drivers/media/video/sh_mobile_ceu_camera.c6
-rw-r--r--linux/drivers/media/video/soc_camera.c5
3 files changed, 10 insertions, 7 deletions
diff --git a/linux/drivers/media/video/pxa_camera.c b/linux/drivers/media/video/pxa_camera.c
index 08723ed84..a585f4138 100644
--- a/linux/drivers/media/video/pxa_camera.c
+++ b/linux/drivers/media/video/pxa_camera.c
@@ -918,6 +918,11 @@ static int pxa_camera_set_fmt_cap(struct soc_camera_device *icd,
static int pxa_camera_try_fmt_cap(struct soc_camera_device *icd,
struct v4l2_format *f)
{
+ int ret = pxa_camera_try_bus_param(icd, f->fmt.pix.pixelformat);
+
+ if (ret < 0)
+ return ret;
+
/* limit to pxa hardware capabilities */
if (f->fmt.pix.height < 32)
f->fmt.pix.height = 32;
@@ -1044,7 +1049,6 @@ static struct soc_camera_host_ops pxa_soc_camera_host_ops = {
.reqbufs = pxa_camera_reqbufs,
.poll = pxa_camera_poll,
.querycap = pxa_camera_querycap,
- .try_bus_param = pxa_camera_try_bus_param,
.set_bus_param = pxa_camera_set_bus_param,
};
diff --git a/linux/drivers/media/video/sh_mobile_ceu_camera.c b/linux/drivers/media/video/sh_mobile_ceu_camera.c
index 2fb8bee0b..0cfcc2fec 100644
--- a/linux/drivers/media/video/sh_mobile_ceu_camera.c
+++ b/linux/drivers/media/video/sh_mobile_ceu_camera.c
@@ -454,6 +454,11 @@ static int sh_mobile_ceu_set_fmt_cap(struct soc_camera_device *icd,
static int sh_mobile_ceu_try_fmt_cap(struct soc_camera_device *icd,
struct v4l2_format *f)
{
+ int ret = sh_mobile_ceu_try_bus_param(icd, f->fmt.pix.pixelformat);
+
+ if (ret < 0)
+ return ret;
+
/* FIXME: calculate using depth and bus width */
if (f->fmt.pix.height < 4)
@@ -541,7 +546,6 @@ static struct soc_camera_host_ops sh_mobile_ceu_host_ops = {
.reqbufs = sh_mobile_ceu_reqbufs,
.poll = sh_mobile_ceu_poll,
.querycap = sh_mobile_ceu_querycap,
- .try_bus_param = sh_mobile_ceu_try_bus_param,
.set_bus_param = sh_mobile_ceu_set_bus_param,
.init_videobuf = sh_mobile_ceu_init_videobuf,
};
diff --git a/linux/drivers/media/video/soc_camera.c b/linux/drivers/media/video/soc_camera.c
index 7a46697c4..1720f8463 100644
--- a/linux/drivers/media/video/soc_camera.c
+++ b/linux/drivers/media/video/soc_camera.c
@@ -78,11 +78,6 @@ static int soc_camera_try_fmt_vid_cap(struct file *file, void *priv,
return -EINVAL;
}
- /* test physical bus parameters */
- ret = ici->ops->try_bus_param(icd, f->fmt.pix.pixelformat);
- if (ret)
- return ret;
-
/* limit format to hardware capabilities */
ret = ici->ops->try_fmt_cap(icd, f);