aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/serio.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/serio.h')
-rw-r--r--include/linux/serio.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/linux/serio.h b/include/linux/serio.h
index aa4d6493a034..582db2392d94 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -18,6 +18,7 @@
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19#include <linux/list.h> 19#include <linux/list.h>
20#include <linux/spinlock.h> 20#include <linux/spinlock.h>
21#include <linux/mutex.h>
21#include <linux/device.h> 22#include <linux/device.h>
22#include <linux/mod_devicetable.h> 23#include <linux/mod_devicetable.h>
23 24
@@ -42,7 +43,7 @@ struct serio {
42 struct serio *parent, *child; 43 struct serio *parent, *child;
43 44
44 struct serio_driver *drv; /* accessed from interrupt, must be protected by serio->lock and serio->sem */ 45 struct serio_driver *drv; /* accessed from interrupt, must be protected by serio->lock and serio->sem */
45 struct semaphore drv_sem; /* protects serio->drv so attributes can pin driver */ 46 struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */
46 47
47 struct device dev; 48 struct device dev;
48 unsigned int registered; /* port has been fully registered with driver core */ 49 unsigned int registered; /* port has been fully registered with driver core */
@@ -151,17 +152,17 @@ static inline void serio_continue_rx(struct serio *serio)
151 */ 152 */
152static inline int serio_pin_driver(struct serio *serio) 153static inline int serio_pin_driver(struct serio *serio)
153{ 154{
154 return down_interruptible(&serio->drv_sem); 155 return mutex_lock_interruptible(&serio->drv_mutex);
155} 156}
156 157
157static inline void serio_pin_driver_uninterruptible(struct serio *serio) 158static inline void serio_pin_driver_uninterruptible(struct serio *serio)
158{ 159{
159 down(&serio->drv_sem); 160 mutex_lock(&serio->drv_mutex);
160} 161}
161 162
162static inline void serio_unpin_driver(struct serio *serio) 163static inline void serio_unpin_driver(struct serio *serio)
163{ 164{
164 up(&serio->drv_sem); 165 mutex_unlock(&serio->drv_mutex);
165} 166}
166 167
167 168