Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / include / linux / gameport.h
index cd623ec..71e7b28 100644 (file)
@@ -11,7 +11,9 @@
 
 #include <asm/io.h>
 #include <linux/list.h>
+#include <linux/mutex.h>
 #include <linux/device.h>
+#include <linux/timer.h>
 
 struct gameport {
 
@@ -39,7 +41,7 @@ struct gameport {
        struct gameport *parent, *child;
 
        struct gameport_driver *drv;
-       struct semaphore drv_sem;       /* protects serio->drv so attributes can pin driver */
+       struct mutex drv_mutex;         /* protects serio->drv so attributes can pin driver */
 
        struct device dev;
        unsigned int registered;        /* port has been fully registered with driver core */
@@ -118,7 +120,7 @@ static inline void gameport_set_name(struct gameport *gameport, const char *name
 }
 
 /*
- * Use the following fucntions to manipulate gameport's per-port
+ * Use the following functions to manipulate gameport's per-port
  * driver-specific data.
  */
 static inline void *gameport_get_drvdata(struct gameport *gameport)
@@ -132,16 +134,16 @@ static inline void gameport_set_drvdata(struct gameport *gameport, void *data)
 }
 
 /*
- * Use the following fucntions to pin gameport's driver in process context
+ * Use the following functions to pin gameport's driver in process context
  */
 static inline int gameport_pin_driver(struct gameport *gameport)
 {
-       return down_interruptible(&gameport->drv_sem);
+       return mutex_lock_interruptible(&gameport->drv_mutex);
 }
 
 static inline void gameport_unpin_driver(struct gameport *gameport)
 {
-       up(&gameport->drv_sem);
+       mutex_unlock(&gameport->drv_mutex);
 }
 
 void __gameport_register_driver(struct gameport_driver *drv, struct module *owner);