aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/marvell-ccic
diff options
context:
space:
mode:
authorLibin Yang <lbyang@marvell.com>2013-07-03 00:56:01 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2013-07-26 12:24:53 -0400
commit1d3953fb16c6d0c6ea099b6cfece08d19e6b1c51 (patch)
tree2cb12c7abe013ce38d45527e4cb3a2575da1df84 /drivers/media/platform/marvell-ccic
parent7c269f454e7a51b151d94f99344120efa1cd0acb (diff)
[media] marvell-ccic: refine mcam_set_contig_buffer function
This patch refines mcam_set_contig_buffer() in mcam core. It can remove redundant code line and enhance readability. Signed-off-by: Albert Wang <twang13@marvell.com> Signed-off-by: Libin Yang <lbyang@marvell.com> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/platform/marvell-ccic')
-rw-r--r--drivers/media/platform/marvell-ccic/mcam-core.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/media/platform/marvell-ccic/mcam-core.c b/drivers/media/platform/marvell-ccic/mcam-core.c
index 56d489bab39b..b0f7e2303ed8 100644
--- a/drivers/media/platform/marvell-ccic/mcam-core.c
+++ b/drivers/media/platform/marvell-ccic/mcam-core.c
@@ -481,22 +481,21 @@ static void mcam_set_contig_buffer(struct mcam_camera *cam, int frame)
481 */ 481 */
482 if (list_empty(&cam->buffers)) { 482 if (list_empty(&cam->buffers)) {
483 buf = cam->vb_bufs[frame ^ 0x1]; 483 buf = cam->vb_bufs[frame ^ 0x1];
484 cam->vb_bufs[frame] = buf;
485 mcam_reg_write(cam, frame == 0 ? REG_Y0BAR : REG_Y1BAR,
486 vb2_dma_contig_plane_dma_addr(&buf->vb_buf, 0));
487 set_bit(CF_SINGLE_BUFFER, &cam->flags); 484 set_bit(CF_SINGLE_BUFFER, &cam->flags);
488 cam->frame_state.singles++; 485 cam->frame_state.singles++;
489 return; 486 } else {
487 /*
488 * OK, we have a buffer we can use.
489 */
490 buf = list_first_entry(&cam->buffers, struct mcam_vb_buffer,
491 queue);
492 list_del_init(&buf->queue);
493 clear_bit(CF_SINGLE_BUFFER, &cam->flags);
490 } 494 }
491 /* 495
492 * OK, we have a buffer we can use. 496 cam->vb_bufs[frame] = buf;
493 */
494 buf = list_first_entry(&cam->buffers, struct mcam_vb_buffer, queue);
495 list_del_init(&buf->queue);
496 mcam_reg_write(cam, frame == 0 ? REG_Y0BAR : REG_Y1BAR, 497 mcam_reg_write(cam, frame == 0 ? REG_Y0BAR : REG_Y1BAR,
497 vb2_dma_contig_plane_dma_addr(&buf->vb_buf, 0)); 498 vb2_dma_contig_plane_dma_addr(&buf->vb_buf, 0));
498 cam->vb_bufs[frame] = buf;
499 clear_bit(CF_SINGLE_BUFFER, &cam->flags);
500} 499}
501 500
502/* 501/*