summaryrefslogtreecommitdiff
path: root/drivers/media/video/pxa_camera.c
diff options
context:
space:
mode:
authorMagnus Damm <magnus.damm@gmail.com>2008-07-12 03:59:34 +0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 14:25:21 +0400
commita034d1b76b173b37f9a3646aa8f50a2c14a0f3ea (patch)
tree318a5ccff6e07d0849c21a2d536ebadb96a767a7 /drivers/media/video/pxa_camera.c
parent092d3921195c4553a1818e698cee7a281ab361f4 (diff)
downloadlinux-a034d1b76b173b37f9a3646aa8f50a2c14a0f3ea.tar.xz
V4L/DVB (8338): soc_camera: Move spinlocks
This patch moves the spinlock handling from soc_camera.c to the actual camera host driver. The spinlock_alloc/free callbacks are replaced with code in init_videobuf(). So far all camera host drivers implement their own spinlock_alloc/free methods anyway, and videobuf_queue_core_init() BUGs on a NULL spinlock argument, so, new camera host drivers will not forget to provide a spinlock when initialising their videobuf queues. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/pxa_camera.c')
-rw-r--r--drivers/media/video/pxa_camera.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c
index c3a7d476dc4b..b15f82c49766 100644
--- a/drivers/media/video/pxa_camera.c
+++ b/drivers/media/video/pxa_camera.c
@@ -583,12 +583,15 @@ static struct videobuf_queue_ops pxa_videobuf_ops = {
.buf_release = pxa_videobuf_release,
};
-static void pxa_camera_init_videobuf(struct videobuf_queue *q, spinlock_t *lock,
+static void pxa_camera_init_videobuf(struct videobuf_queue *q,
struct soc_camera_device *icd)
{
+ struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
+ struct pxa_camera_dev *pcdev = ici->priv;
+
/* We must pass NULL as dev pointer, then all pci_* dma operations
* transform to normal dma_* ones. */
- videobuf_queue_sg_init(q, &pxa_videobuf_ops, NULL, lock,
+ videobuf_queue_sg_init(q, &pxa_videobuf_ops, NULL, &pcdev->lock,
V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_NONE,
sizeof(struct pxa_buffer), icd);
}
@@ -994,15 +997,6 @@ static int pxa_camera_querycap(struct soc_camera_host *ici,
return 0;
}
-static spinlock_t *pxa_camera_spinlock_alloc(struct soc_camera_file *icf)
-{
- struct soc_camera_host *ici =
- to_soc_camera_host(icf->icd->dev.parent);
- struct pxa_camera_dev *pcdev = ici->priv;
-
- return &pcdev->lock;
-}
-
static struct soc_camera_host_ops pxa_soc_camera_host_ops = {
.owner = THIS_MODULE,
.add = pxa_camera_add_device,
@@ -1015,7 +1009,6 @@ static struct soc_camera_host_ops pxa_soc_camera_host_ops = {
.querycap = pxa_camera_querycap,
.try_bus_param = pxa_camera_try_bus_param,
.set_bus_param = pxa_camera_set_bus_param,
- .spinlock_alloc = pxa_camera_spinlock_alloc,
};
/* Should be allocated dynamically too, but we have only one. */