X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Flinux%2Fgameport.h;fp=include%2Flinux%2Fgameport.h;h=2401dea2b867c798808f0433f575db7e0888f9b6;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=2cdba0c2395707184544ee755e9a5f9ddefbe9a1;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c;p=linux-2.6.git diff --git a/include/linux/gameport.h b/include/linux/gameport.h index 2cdba0c23..2401dea2b 100644 --- a/include/linux/gameport.h +++ b/include/linux/gameport.h @@ -9,10 +9,8 @@ * the Free Software Foundation. */ -#ifdef __KERNEL__ #include #include -#include #include #include @@ -42,7 +40,7 @@ struct gameport { struct gameport *parent, *child; struct gameport_driver *drv; - struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */ + struct semaphore drv_sem; /* protects serio->drv so attributes can pin driver */ struct device dev; unsigned int registered; /* port has been fully registered with driver core */ @@ -121,7 +119,7 @@ static inline void gameport_set_name(struct gameport *gameport, const char *name } /* - * Use the following functions to manipulate gameport's per-port + * Use the following fucntions to manipulate gameport's per-port * driver-specific data. */ static inline void *gameport_get_drvdata(struct gameport *gameport) @@ -135,16 +133,16 @@ static inline void gameport_set_drvdata(struct gameport *gameport, void *data) } /* - * Use the following functions to pin gameport's driver in process context + * Use the following fucntions to pin gameport's driver in process context */ static inline int gameport_pin_driver(struct gameport *gameport) { - return mutex_lock_interruptible(&gameport->drv_mutex); + return down_interruptible(&gameport->drv_sem); } static inline void gameport_unpin_driver(struct gameport *gameport) { - mutex_unlock(&gameport->drv_mutex); + up(&gameport->drv_sem); } void __gameport_register_driver(struct gameport_driver *drv, struct module *owner); @@ -155,8 +153,6 @@ static inline void gameport_register_driver(struct gameport_driver *drv) void gameport_unregister_driver(struct gameport_driver *drv); -#endif /* __KERNEL__ */ - #define GAMEPORT_MODE_DISABLED 0 #define GAMEPORT_MODE_RAW 1 #define GAMEPORT_MODE_COOKED 2 @@ -172,8 +168,6 @@ void gameport_unregister_driver(struct gameport_driver *drv); #define GAMEPORT_ID_VENDOR_GRAVIS 0x0009 #define GAMEPORT_ID_VENDOR_GUILLEMOT 0x000a -#ifdef __KERNEL__ - static inline void gameport_trigger(struct gameport *gameport) { if (gameport->trigger) @@ -224,5 +218,4 @@ static inline void gameport_set_poll_interval(struct gameport *gameport, unsigne void gameport_start_polling(struct gameport *gameport); void gameport_stop_polling(struct gameport *gameport); -#endif /* __KERNEL__ */ #endif