Commit 15984745 authored by Vojtech Pavlik's avatar Vojtech Pavlik

Add a wrapper function for serio ->interrupt callback.

This cleans up things somewhat and also will allow better
hotplugging detection in the future.
parent fef3dcc0
...@@ -156,8 +156,7 @@ static struct serio ct82c710_port = ...@@ -156,8 +156,7 @@ static struct serio ct82c710_port =
static void ct82c710_interrupt(int cpl, void *dev_id, struct pt_regs * regs) static void ct82c710_interrupt(int cpl, void *dev_id, struct pt_regs * regs)
{ {
if (ct82c710_port.dev) serio_interrupt(&ct82c710_port, inb(ct82c710_data), 0);
ct82c710_port.dev->interrupt(&ct82c710_port, inb(ct82c710_data), 0);
} }
/* /*
......
...@@ -387,14 +387,13 @@ static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -387,14 +387,13 @@ static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
#endif #endif
if (i8042_aux_values.exists && (str & I8042_STR_AUXDATA)) { if (i8042_aux_values.exists && (str & I8042_STR_AUXDATA)) {
if (i8042_aux_port.dev) serio_interrupt(&i8042_aux_port, data, 0);
i8042_aux_port.dev->interrupt(&i8042_aux_port, data, 0);
} else { } else {
if (i8042_kbd_values.exists && i8042_kbd_port.dev) { if (i8042_kbd_values.exists) {
if (!i8042_direct) { if (!i8042_direct) {
if (data > 0x7f) { if (data > 0x7f) {
if (test_and_clear_bit(data & 0x7f, i8042_unxlate_seen)) { if (test_and_clear_bit(data & 0x7f, i8042_unxlate_seen)) {
i8042_kbd_port.dev->interrupt(&i8042_kbd_port, 0xf0, 0); serio_interrupt(&i8042_kbd_port, 0xf0, 0);
data = i8042_unxlate_table[data & 0x7f]; data = i8042_unxlate_table[data & 0x7f];
} }
} else { } else {
...@@ -402,7 +401,7 @@ static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -402,7 +401,7 @@ static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
data = i8042_unxlate_table[data]; data = i8042_unxlate_table[data];
} }
} }
i8042_kbd_port.dev->interrupt(&i8042_kbd_port, data, 0); serio_interrupt(&i8042_kbd_port, data, 0);
} }
} }
} }
......
...@@ -135,10 +135,8 @@ static void parkbd_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -135,10 +135,8 @@ static void parkbd_interrupt(int irq, void *dev_id, struct pt_regs *regs)
parkbd_buffer |= (parkbd_readlines() >> 1) << parkbd_counter++; parkbd_buffer |= (parkbd_readlines() >> 1) << parkbd_counter++;
if (parkbd_counter == parkbd_mode + 10) { if (parkbd_counter == parkbd_mode + 10)
if (parkbd_port.dev) serio_interrupt(&parkbd_port, (parkbd_buffer >> (2 - parkbd_mode)) & 0xff, 0);
parkbd_port.dev->interrupt(&parkbd_port, (parkbd_buffer >> (2 - parkbd_mode)) & 0xff, 0);
}
} }
parkbd_last = jiffies; parkbd_last = jiffies;
......
...@@ -64,8 +64,7 @@ static void rpckbd_rx(int irq, void *dev_id, struct pt_regs *regs) ...@@ -64,8 +64,7 @@ static void rpckbd_rx(int irq, void *dev_id, struct pt_regs *regs)
kbd_pt_regs = regs; kbd_pt_regs = regs;
while (inb(IOMD_KCTRL) & (1 << 5)) while (inb(IOMD_KCTRL) & (1 << 5))
if (rpckbd_port.dev) serio_interrupt(&rpckbd_port, inb(IOMD_KARTRX), 0);
rpckbd_port.dev->interrupt(&rpckbd_port, inb(IOMD_KARTRX), 0);
} }
......
...@@ -138,8 +138,7 @@ static void serport_ldisc_receive(struct tty_struct *tty, const unsigned char *c ...@@ -138,8 +138,7 @@ static void serport_ldisc_receive(struct tty_struct *tty, const unsigned char *c
struct serport *serport = (struct serport*) tty->disc_data; struct serport *serport = (struct serport*) tty->disc_data;
int i; int i;
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
if (serport->serio.dev) serio_interrupt(&serport->serio, cp[i], 0);
serport->serio.dev->interrupt(&serport->serio, cp[i], 0);
} }
/* /*
......
...@@ -89,9 +89,14 @@ static __inline__ int serio_write(struct serio *serio, unsigned char data) ...@@ -89,9 +89,14 @@ static __inline__ int serio_write(struct serio *serio, unsigned char data)
static __inline__ void serio_dev_write_wakeup(struct serio *serio) static __inline__ void serio_dev_write_wakeup(struct serio *serio)
{ {
if (serio->dev && serio->dev->write_wakeup) { if (serio->dev && serio->dev->write_wakeup)
serio->dev->write_wakeup(serio); serio->dev->write_wakeup(serio);
} }
static __inline__ void serio_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
{
if (serio->dev && serio->dev->interrupt)
serio->dev->interrupt(serio, data, flags);
} }
#define SERIO_TIMEOUT 1 #define SERIO_TIMEOUT 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment