aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pxa_camera.c
diff options
context:
space:
mode:
authorroel kluin <roel.kluin@gmail.com>2008-09-18 16:50:15 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-12 07:37:02 -0400
commitde3e3b82a6d15264798d4e36f42abaa69f53ca06 (patch)
tree44452bd9c81d767d9ab7965eff5021330f7f2513 /drivers/media/video/pxa_camera.c
parent26dc4d0487bb8b8de32d09c18a83c63d622156f2 (diff)
V4L/DVB: pxa-camera: Unsigned dma_chans[] cannot be negative
Unsigned dma_chans[] cannot be negative Also the third time dma_chans[0] < 0 was tested instead of dma_chans[2] Signed-off-by: Roel Kluin <roel.kluin@gmail.com> 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.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c
index 14569b591388..eb6be5802928 100644
--- a/drivers/media/video/pxa_camera.c
+++ b/drivers/media/video/pxa_camera.c
@@ -1120,31 +1120,31 @@ static int pxa_camera_probe(struct platform_device *pdev)
1120 pcdev->dev = &pdev->dev; 1120 pcdev->dev = &pdev->dev;
1121 1121
1122 /* request dma */ 1122 /* request dma */
1123 pcdev->dma_chans[0] = pxa_request_dma("CI_Y", DMA_PRIO_HIGH, 1123 err = pxa_request_dma("CI_Y", DMA_PRIO_HIGH,
1124 pxa_camera_dma_irq_y, pcdev); 1124 pxa_camera_dma_irq_y, pcdev);
1125 if (pcdev->dma_chans[0] < 0) { 1125 if (err < 0) {
1126 dev_err(pcdev->dev, "Can't request DMA for Y\n"); 1126 dev_err(pcdev->dev, "Can't request DMA for Y\n");
1127 err = -ENOMEM;
1128 goto exit_iounmap; 1127 goto exit_iounmap;
1129 } 1128 }
1129 pcdev->dma_chans[0] = err;
1130 dev_dbg(pcdev->dev, "got DMA channel %d\n", pcdev->dma_chans[0]); 1130 dev_dbg(pcdev->dev, "got DMA channel %d\n", pcdev->dma_chans[0]);
1131 1131
1132 pcdev->dma_chans[1] = pxa_request_dma("CI_U", DMA_PRIO_HIGH, 1132 err = pxa_request_dma("CI_U", DMA_PRIO_HIGH,
1133 pxa_camera_dma_irq_u, pcdev); 1133 pxa_camera_dma_irq_u, pcdev);
1134 if (pcdev->dma_chans[1] < 0) { 1134 if (err < 0) {
1135 dev_err(pcdev->dev, "Can't request DMA for U\n"); 1135 dev_err(pcdev->dev, "Can't request DMA for U\n");
1136 err = -ENOMEM;
1137 goto exit_free_dma_y; 1136 goto exit_free_dma_y;
1138 } 1137 }
1138 pcdev->dma_chans[1] = err;
1139 dev_dbg(pcdev->dev, "got DMA channel (U) %d\n", pcdev->dma_chans[1]); 1139 dev_dbg(pcdev->dev, "got DMA channel (U) %d\n", pcdev->dma_chans[1]);
1140 1140
1141 pcdev->dma_chans[2] = pxa_request_dma("CI_V", DMA_PRIO_HIGH, 1141 err = pxa_request_dma("CI_V", DMA_PRIO_HIGH,
1142 pxa_camera_dma_irq_v, pcdev); 1142 pxa_camera_dma_irq_v, pcdev);
1143 if (pcdev->dma_chans[0] < 0) { 1143 if (err < 0) {
1144 dev_err(pcdev->dev, "Can't request DMA for V\n"); 1144 dev_err(pcdev->dev, "Can't request DMA for V\n");
1145 err = -ENOMEM;
1146 goto exit_free_dma_u; 1145 goto exit_free_dma_u;
1147 } 1146 }
1147 pcdev->dma_chans[2] = err;
1148 dev_dbg(pcdev->dev, "got DMA channel (V) %d\n", pcdev->dma_chans[2]); 1148 dev_dbg(pcdev->dev, "got DMA channel (V) %d\n", pcdev->dma_chans[2]);
1149 1149
1150 DRCMR(68) = pcdev->dma_chans[0] | DRCMR_MAPVLD; 1150 DRCMR(68) = pcdev->dma_chans[0] | DRCMR_MAPVLD;