diff mbox

[1/4] V4L: Int if: v4l2_int_device_try_attach_all requires mutex

Message ID 1235752293-14452-1-git-send-email-sakari.ailus@maxwell.research.nokia.com (mailing list archive)
State RFC
Headers show

Commit Message

Sakari Ailus Feb. 27, 2009, 4:31 p.m. UTC
From: Sakari Ailus <sakari.ailus@nokia.com>

Signed-off-by: Sakari Ailus <sakari.ailus@nokia.com>
---
 drivers/media/video/v4l2-int-device.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/media/video/v4l2-int-device.c b/drivers/media/video/v4l2-int-device.c
index a935bae..eb8dc84 100644
--- a/drivers/media/video/v4l2-int-device.c
+++ b/drivers/media/video/v4l2-int-device.c
@@ -32,7 +32,7 @@ 
 static DEFINE_MUTEX(mutex);
 static LIST_HEAD(int_list);
 
-void v4l2_int_device_try_attach_all(void)
+static void __v4l2_int_device_try_attach_all(void)
 {
 	struct v4l2_int_device *m, *s;
 
@@ -66,6 +66,14 @@  void v4l2_int_device_try_attach_all(void)
 		}
 	}
 }
+
+void v4l2_int_device_try_attach_all(void)
+{
+	mutex_lock(&mutex);
+	__v4l2_int_device_try_attach_all();
+	mutex_unlock(&mutex);
+}
+
 EXPORT_SYMBOL_GPL(v4l2_int_device_try_attach_all);
 
 static int ioctl_sort_cmp(const void *a, const void *b)
@@ -89,7 +97,7 @@  int v4l2_int_device_register(struct v4l2_int_device *d)
 		     &ioctl_sort_cmp, NULL);
 	mutex_lock(&mutex);
 	list_add(&d->head, &int_list);
-	v4l2_int_device_try_attach_all();
+	__v4l2_int_device_try_attach_all();
 	mutex_unlock(&mutex);
 
 	return 0;