lists.zerezo.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 01/07] soc_camera: Remove default spinlock operations



This patch removes the default spinlock_alloc() and spinlock_free()
functions. The pxa_camera.c driver is providing it's own spinlock
callbacks anyway. With this patch spinlock callbacks are required
when registering the host.

This is ground work for the next per-host videobuf queue patch.

Signed-off-by: Magnus Damm <damm@xxxxxxxxxx>
---

 drivers/media/video/soc_camera.c |   23 ++---------------------
 1 file changed, 2 insertions(+), 21 deletions(-)

--- 0001/drivers/media/video/soc_camera.c
+++ work/drivers/media/video/soc_camera.c	2008-06-12 14:05:36.000000000 +0900
@@ -776,27 +776,13 @@ static void dummy_release(struct device 
 {
 }
 
-static spinlock_t *spinlock_alloc(struct soc_camera_file *icf)
-{
-	spinlock_t *lock = kmalloc(sizeof(spinlock_t), GFP_KERNEL);
-
-	if (lock)
-		spin_lock_init(lock);
-
-	return lock;
-}
-
-static void spinlock_free(spinlock_t *lock)
-{
-	kfree(lock);
-}
-
 int soc_camera_host_register(struct soc_camera_host *ici)
 {
 	int ret;
 	struct soc_camera_host *ix;
 
-	if (!ici->vbq_ops || !ici->ops->add || !ici->ops->remove)
+	if (!ici->vbq_ops || !ici->ops->add || !ici->ops->remove
+	    || !ici->ops->spinlock_alloc)
 		return -EINVAL;
 
 	/* Number might be equal to the platform device ID */
@@ -821,11 +807,6 @@ int soc_camera_host_register(struct soc_
 	if (ret)
 		goto edevr;
 
-	if (!ici->ops->spinlock_alloc) {
-		ici->ops->spinlock_alloc = spinlock_alloc;
-		ici->ops->spinlock_free = spinlock_free;
-	}
-
 	scan_add_host(ici);
 
 	return 0;

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list