diff options
Diffstat (limited to 'drivers/input/serio/libps2.c')
-rw-r--r-- | drivers/input/serio/libps2.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/input/serio/libps2.c b/drivers/input/serio/libps2.c index d4c990f7c85e..79c97f94bcbd 100644 --- a/drivers/input/serio/libps2.c +++ b/drivers/input/serio/libps2.c | |||
@@ -84,7 +84,7 @@ void ps2_drain(struct ps2dev *ps2dev, int maxbytes, int timeout) | |||
84 | maxbytes = sizeof(ps2dev->cmdbuf); | 84 | maxbytes = sizeof(ps2dev->cmdbuf); |
85 | } | 85 | } |
86 | 86 | ||
87 | down(&ps2dev->cmd_sem); | 87 | mutex_lock(&ps2dev->cmd_mutex); |
88 | 88 | ||
89 | serio_pause_rx(ps2dev->serio); | 89 | serio_pause_rx(ps2dev->serio); |
90 | ps2dev->flags = PS2_FLAG_CMD; | 90 | ps2dev->flags = PS2_FLAG_CMD; |
@@ -94,7 +94,7 @@ void ps2_drain(struct ps2dev *ps2dev, int maxbytes, int timeout) | |||
94 | wait_event_timeout(ps2dev->wait, | 94 | wait_event_timeout(ps2dev->wait, |
95 | !(ps2dev->flags & PS2_FLAG_CMD), | 95 | !(ps2dev->flags & PS2_FLAG_CMD), |
96 | msecs_to_jiffies(timeout)); | 96 | msecs_to_jiffies(timeout)); |
97 | up(&ps2dev->cmd_sem); | 97 | mutex_unlock(&ps2dev->cmd_mutex); |
98 | } | 98 | } |
99 | 99 | ||
100 | /* | 100 | /* |
@@ -177,7 +177,7 @@ int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command) | |||
177 | return -1; | 177 | return -1; |
178 | } | 178 | } |
179 | 179 | ||
180 | down(&ps2dev->cmd_sem); | 180 | mutex_lock(&ps2dev->cmd_mutex); |
181 | 181 | ||
182 | serio_pause_rx(ps2dev->serio); | 182 | serio_pause_rx(ps2dev->serio); |
183 | ps2dev->flags = command == PS2_CMD_GETID ? PS2_FLAG_WAITID : 0; | 183 | ps2dev->flags = command == PS2_CMD_GETID ? PS2_FLAG_WAITID : 0; |
@@ -229,7 +229,7 @@ int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command) | |||
229 | ps2dev->flags = 0; | 229 | ps2dev->flags = 0; |
230 | serio_continue_rx(ps2dev->serio); | 230 | serio_continue_rx(ps2dev->serio); |
231 | 231 | ||
232 | up(&ps2dev->cmd_sem); | 232 | mutex_unlock(&ps2dev->cmd_mutex); |
233 | return rc; | 233 | return rc; |
234 | } | 234 | } |
235 | 235 | ||
@@ -281,7 +281,7 @@ int ps2_schedule_command(struct ps2dev *ps2dev, unsigned char *param, int comman | |||
281 | 281 | ||
282 | void ps2_init(struct ps2dev *ps2dev, struct serio *serio) | 282 | void ps2_init(struct ps2dev *ps2dev, struct serio *serio) |
283 | { | 283 | { |
284 | init_MUTEX(&ps2dev->cmd_sem); | 284 | mutex_init(&ps2dev->cmd_mutex); |
285 | init_waitqueue_head(&ps2dev->wait); | 285 | init_waitqueue_head(&ps2dev->wait); |
286 | ps2dev->serio = serio; | 286 | ps2dev->serio = serio; |
287 | } | 287 | } |