aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/joystick/warrior.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/joystick/warrior.c')
-rw-r--r--drivers/input/joystick/warrior.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/input/joystick/warrior.c b/drivers/input/joystick/warrior.c
index f9c1a03214eb..35edea1ab955 100644
--- a/drivers/input/joystick/warrior.c
+++ b/drivers/input/joystick/warrior.c
@@ -64,15 +64,13 @@ struct warrior {
64 * Warrior. It updates the data accordingly. 64 * Warrior. It updates the data accordingly.
65 */ 65 */
66 66
67static void warrior_process_packet(struct warrior *warrior, struct pt_regs *regs) 67static void warrior_process_packet(struct warrior *warrior)
68{ 68{
69 struct input_dev *dev = warrior->dev; 69 struct input_dev *dev = warrior->dev;
70 unsigned char *data = warrior->data; 70 unsigned char *data = warrior->data;
71 71
72 if (!warrior->idx) return; 72 if (!warrior->idx) return;
73 73
74 input_regs(dev, regs);
75
76 switch ((data[0] >> 4) & 7) { 74 switch ((data[0] >> 4) & 7) {
77 case 1: /* Button data */ 75 case 1: /* Button data */
78 input_report_key(dev, BTN_TRIGGER, data[3] & 1); 76 input_report_key(dev, BTN_TRIGGER, data[3] & 1);
@@ -101,12 +99,12 @@ static void warrior_process_packet(struct warrior *warrior, struct pt_regs *regs
101 */ 99 */
102 100
103static irqreturn_t warrior_interrupt(struct serio *serio, 101static irqreturn_t warrior_interrupt(struct serio *serio,
104 unsigned char data, unsigned int flags, struct pt_regs *regs) 102 unsigned char data, unsigned int flags)
105{ 103{
106 struct warrior *warrior = serio_get_drvdata(serio); 104 struct warrior *warrior = serio_get_drvdata(serio);
107 105
108 if (data & 0x80) { 106 if (data & 0x80) {
109 if (warrior->idx) warrior_process_packet(warrior, regs); 107 if (warrior->idx) warrior_process_packet(warrior);
110 warrior->idx = 0; 108 warrior->idx = 0;
111 warrior->len = warrior_lengths[(data >> 4) & 7]; 109 warrior->len = warrior_lengths[(data >> 4) & 7];
112 } 110 }
@@ -115,7 +113,7 @@ static irqreturn_t warrior_interrupt(struct serio *serio,
115 warrior->data[warrior->idx++] = data; 113 warrior->data[warrior->idx++] = data;
116 114
117 if (warrior->idx == warrior->len) { 115 if (warrior->idx == warrior->len) {
118 if (warrior->idx) warrior_process_packet(warrior, regs); 116 if (warrior->idx) warrior_process_packet(warrior);
119 warrior->idx = 0; 117 warrior->idx = 0;
120 warrior->len = 0; 118 warrior->len = 0;
121 } 119 }