aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pxa_camera.c
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2008-12-18 09:51:55 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-30 06:40:21 -0500
commit64f5905ee74906643e22657bd20e2f11443053f0 (patch)
tree17aaf01284c3297d835f3167098be9333df9b188 /drivers/media/video/pxa_camera.c
parent9414de39e8e07d90bdb6524be501fae0e013d37b (diff)
V4L/DVB (10080): soc-camera: readability improvements, more strict operations checks
Simplify multiple drivers by replacing f->fmt.pix.* with a single pointer dereference, merge some needlessly broken lines, verify host and camera operations pointers on registration. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/pxa_camera.c')
-rw-r--r--drivers/media/video/pxa_camera.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c
index 28ea13f7b2b0..f6919a0e2ac2 100644
--- a/drivers/media/video/pxa_camera.c
+++ b/drivers/media/video/pxa_camera.c
@@ -240,8 +240,7 @@ static int pxa_videobuf_setup(struct videobuf_queue *vq, unsigned int *count,
240 unsigned int *size) 240 unsigned int *size)
241{ 241{
242 struct soc_camera_device *icd = vq->priv_data; 242 struct soc_camera_device *icd = vq->priv_data;
243 struct soc_camera_host *ici = 243 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
244 to_soc_camera_host(icd->dev.parent);
245 struct pxa_camera_dev *pcdev = ici->priv; 244 struct pxa_camera_dev *pcdev = ici->priv;
246 245
247 dev_dbg(&icd->dev, "count=%d, size=%d\n", *count, *size); 246 dev_dbg(&icd->dev, "count=%d, size=%d\n", *count, *size);
@@ -267,8 +266,7 @@ static int pxa_videobuf_setup(struct videobuf_queue *vq, unsigned int *count,
267static void free_buffer(struct videobuf_queue *vq, struct pxa_buffer *buf) 266static void free_buffer(struct videobuf_queue *vq, struct pxa_buffer *buf)
268{ 267{
269 struct soc_camera_device *icd = vq->priv_data; 268 struct soc_camera_device *icd = vq->priv_data;
270 struct soc_camera_host *ici = 269 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
271 to_soc_camera_host(icd->dev.parent);
272 struct pxa_camera_dev *pcdev = ici->priv; 270 struct pxa_camera_dev *pcdev = ici->priv;
273 struct videobuf_dmabuf *dma = videobuf_to_dma(&buf->vb); 271 struct videobuf_dmabuf *dma = videobuf_to_dma(&buf->vb);
274 int i; 272 int i;
@@ -344,8 +342,7 @@ static int pxa_videobuf_prepare(struct videobuf_queue *vq,
344 struct videobuf_buffer *vb, enum v4l2_field field) 342 struct videobuf_buffer *vb, enum v4l2_field field)
345{ 343{
346 struct soc_camera_device *icd = vq->priv_data; 344 struct soc_camera_device *icd = vq->priv_data;
347 struct soc_camera_host *ici = 345 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
348 to_soc_camera_host(icd->dev.parent);
349 struct pxa_camera_dev *pcdev = ici->priv; 346 struct pxa_camera_dev *pcdev = ici->priv;
350 struct pxa_buffer *buf = container_of(vb, struct pxa_buffer, vb); 347 struct pxa_buffer *buf = container_of(vb, struct pxa_buffer, vb);
351 int ret; 348 int ret;
@@ -464,8 +461,7 @@ static void pxa_videobuf_queue(struct videobuf_queue *vq,
464 struct videobuf_buffer *vb) 461 struct videobuf_buffer *vb)
465{ 462{
466 struct soc_camera_device *icd = vq->priv_data; 463 struct soc_camera_device *icd = vq->priv_data;
467 struct soc_camera_host *ici = 464 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
468 to_soc_camera_host(icd->dev.parent);
469 struct pxa_camera_dev *pcdev = ici->priv; 465 struct pxa_camera_dev *pcdev = ici->priv;
470 struct pxa_buffer *buf = container_of(vb, struct pxa_buffer, vb); 466 struct pxa_buffer *buf = container_of(vb, struct pxa_buffer, vb);
471 struct pxa_buffer *active; 467 struct pxa_buffer *active;
@@ -915,8 +911,7 @@ static int test_platform_param(struct pxa_camera_dev *pcdev,
915 911
916static int pxa_camera_set_bus_param(struct soc_camera_device *icd, __u32 pixfmt) 912static int pxa_camera_set_bus_param(struct soc_camera_device *icd, __u32 pixfmt)
917{ 913{
918 struct soc_camera_host *ici = 914 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
919 to_soc_camera_host(icd->dev.parent);
920 struct pxa_camera_dev *pcdev = ici->priv; 915 struct pxa_camera_dev *pcdev = ici->priv;
921 unsigned long dw, bpp, bus_flags, camera_flags, common_flags; 916 unsigned long dw, bpp, bus_flags, camera_flags, common_flags;
922 u32 cicr0, cicr1, cicr2, cicr3, cicr4 = 0; 917 u32 cicr0, cicr1, cicr2, cicr3, cicr4 = 0;
@@ -1298,8 +1293,7 @@ static int pxa_camera_querycap(struct soc_camera_host *ici,
1298 1293
1299static int pxa_camera_suspend(struct soc_camera_device *icd, pm_message_t state) 1294static int pxa_camera_suspend(struct soc_camera_device *icd, pm_message_t state)
1300{ 1295{
1301 struct soc_camera_host *ici = 1296 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
1302 to_soc_camera_host(icd->dev.parent);
1303 struct pxa_camera_dev *pcdev = ici->priv; 1297 struct pxa_camera_dev *pcdev = ici->priv;
1304 int i = 0, ret = 0; 1298 int i = 0, ret = 0;
1305 1299
@@ -1317,8 +1311,7 @@ static int pxa_camera_suspend(struct soc_camera_device *icd, pm_message_t state)
1317 1311
1318static int pxa_camera_resume(struct soc_camera_device *icd) 1312static int pxa_camera_resume(struct soc_camera_device *icd)
1319{ 1313{
1320 struct soc_camera_host *ici = 1314 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
1321 to_soc_camera_host(icd->dev.parent);
1322 struct pxa_camera_dev *pcdev = ici->priv; 1315 struct pxa_camera_dev *pcdev = ici->priv;
1323 int i = 0, ret = 0; 1316 int i = 0, ret = 0;
1324 1317