Input: serio - semaphore to mutex conversion

The conversion was generated via scripts, and the result was validated
automatically via a script as well.

Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index 2f76813..79e5e77 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -34,6 +34,7 @@
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/kthread.h>
+#include <linux/mutex.h>
 
 MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
 MODULE_DESCRIPTION("Serio abstraction core");
@@ -52,10 +53,10 @@
 EXPORT_SYMBOL(serio_reconnect);
 
 /*
- * serio_sem protects entire serio subsystem and is taken every time
+ * serio_mutex protects entire serio subsystem and is taken every time
  * serio port or driver registrered or unregistered.
  */
-static DECLARE_MUTEX(serio_sem);
+static DEFINE_MUTEX(serio_mutex);
 
 static LIST_HEAD(serio_list);
 
@@ -70,9 +71,9 @@
 {
 	int retval;
 
-	down(&serio->drv_sem);
+	mutex_lock(&serio->drv_mutex);
 	retval = drv->connect(serio, drv);
-	up(&serio->drv_sem);
+	mutex_unlock(&serio->drv_mutex);
 
 	return retval;
 }
@@ -81,20 +82,20 @@
 {
 	int retval = -1;
 
-	down(&serio->drv_sem);
+	mutex_lock(&serio->drv_mutex);
 	if (serio->drv && serio->drv->reconnect)
 		retval = serio->drv->reconnect(serio);
-	up(&serio->drv_sem);
+	mutex_unlock(&serio->drv_mutex);
 
 	return retval;
 }
 
 static void serio_disconnect_driver(struct serio *serio)
 {
-	down(&serio->drv_sem);
+	mutex_lock(&serio->drv_mutex);
 	if (serio->drv)
 		serio->drv->disconnect(serio);
-	up(&serio->drv_sem);
+	mutex_unlock(&serio->drv_mutex);
 }
 
 static int serio_match_port(const struct serio_device_id *ids, struct serio *serio)
@@ -272,7 +273,7 @@
 	struct serio_event *event;
 	struct serio_driver *serio_drv;
 
-	down(&serio_sem);
+	mutex_lock(&serio_mutex);
 
 	/*
 	 * Note that we handle only one event here to give swsusp
@@ -314,7 +315,7 @@
 		serio_free_event(event);
 	}
 
-	up(&serio_sem);
+	mutex_unlock(&serio_mutex);
 }
 
 /*
@@ -449,7 +450,7 @@
 	struct device_driver *drv;
 	int retval;
 
-	retval = down_interruptible(&serio_sem);
+	retval = mutex_lock_interruptible(&serio_mutex);
 	if (retval)
 		return retval;
 
@@ -469,7 +470,7 @@
 		retval = -EINVAL;
 	}
 
-	up(&serio_sem);
+	mutex_unlock(&serio_mutex);
 
 	return retval;
 }
@@ -524,7 +525,7 @@
 	__module_get(THIS_MODULE);
 
 	spin_lock_init(&serio->lock);
-	init_MUTEX(&serio->drv_sem);
+	mutex_init(&serio->drv_mutex);
 	device_initialize(&serio->dev);
 	snprintf(serio->dev.bus_id, sizeof(serio->dev.bus_id),
 		 "serio%ld", (long)atomic_inc_return(&serio_no) - 1);
@@ -661,10 +662,10 @@
  */
 void serio_unregister_port(struct serio *serio)
 {
-	down(&serio_sem);
+	mutex_lock(&serio_mutex);
 	serio_disconnect_port(serio);
 	serio_destroy_port(serio);
-	up(&serio_sem);
+	mutex_unlock(&serio_mutex);
 }
 
 /*
@@ -672,17 +673,17 @@
  */
 void serio_unregister_child_port(struct serio *serio)
 {
-	down(&serio_sem);
+	mutex_lock(&serio_mutex);
 	if (serio->child) {
 		serio_disconnect_port(serio->child);
 		serio_destroy_port(serio->child);
 	}
-	up(&serio_sem);
+	mutex_unlock(&serio_mutex);
 }
 
 /*
  * Submits register request to kseriod for subsequent execution.
- * Can be used when it is not obvious whether the serio_sem is
+ * Can be used when it is not obvious whether the serio_mutex is
  * taken or not and when delayed execution is feasible.
  */
 void __serio_unregister_port_delayed(struct serio *serio, struct module *owner)
@@ -765,7 +766,7 @@
 {
 	struct serio *serio;
 
-	down(&serio_sem);
+	mutex_lock(&serio_mutex);
 	drv->manual_bind = 1;	/* so serio_find_driver ignores it */
 
 start_over:
@@ -779,7 +780,7 @@
 	}
 
 	driver_unregister(&drv->driver);
-	up(&serio_sem);
+	mutex_unlock(&serio_mutex);
 }
 
 static void serio_set_drv(struct serio *serio, struct serio_driver *drv)
@@ -858,7 +859,7 @@
 	return 0;
 }
 
-/* called from serio_driver->connect/disconnect methods under serio_sem */
+/* called from serio_driver->connect/disconnect methods under serio_mutex */
 int serio_open(struct serio *serio, struct serio_driver *drv)
 {
 	serio_set_drv(serio, drv);
@@ -870,7 +871,7 @@
 	return 0;
 }
 
-/* called from serio_driver->connect/disconnect methods under serio_sem */
+/* called from serio_driver->connect/disconnect methods under serio_mutex */
 void serio_close(struct serio *serio)
 {
 	if (serio->close)