summaryrefslogtreecommitdiffstats
path: root/kernel/drivers/input/serio/libps2.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/drivers/input/serio/libps2.c')
-rw-r--r--kernel/drivers/input/serio/libps2.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/kernel/drivers/input/serio/libps2.c b/kernel/drivers/input/serio/libps2.c
index 316f2c897..83e9c663a 100644
--- a/kernel/drivers/input/serio/libps2.c
+++ b/kernel/drivers/input/serio/libps2.c
@@ -56,19 +56,17 @@ EXPORT_SYMBOL(ps2_sendbyte);
void ps2_begin_command(struct ps2dev *ps2dev)
{
- mutex_lock(&ps2dev->cmd_mutex);
+ struct mutex *m = ps2dev->serio->ps2_cmd_mutex ?: &ps2dev->cmd_mutex;
- if (i8042_check_port_owner(ps2dev->serio))
- i8042_lock_chip();
+ mutex_lock(m);
}
EXPORT_SYMBOL(ps2_begin_command);
void ps2_end_command(struct ps2dev *ps2dev)
{
- if (i8042_check_port_owner(ps2dev->serio))
- i8042_unlock_chip();
+ struct mutex *m = ps2dev->serio->ps2_cmd_mutex ?: &ps2dev->cmd_mutex;
- mutex_unlock(&ps2dev->cmd_mutex);
+ mutex_unlock(m);
}
EXPORT_SYMBOL(ps2_end_command);