diff options
-rw-r--r-- | drivers/tty/amiserial.c | 23 | ||||
-rw-r--r-- | include/linux/serialP.h | 3 |
2 files changed, 10 insertions, 16 deletions
diff --git a/drivers/tty/amiserial.c b/drivers/tty/amiserial.c index a9f5da64eef2..b182bccf3eab 100644 --- a/drivers/tty/amiserial.c +++ b/drivers/tty/amiserial.c | |||
@@ -1008,7 +1008,7 @@ static void rs_unthrottle(struct tty_struct * tty) | |||
1008 | * ------------------------------------------------------------ | 1008 | * ------------------------------------------------------------ |
1009 | */ | 1009 | */ |
1010 | 1010 | ||
1011 | static int get_serial_info(struct serial_state *state, | 1011 | static int get_serial_info(struct tty_struct *tty, struct serial_state *state, |
1012 | struct serial_struct __user * retinfo) | 1012 | struct serial_struct __user * retinfo) |
1013 | { | 1013 | { |
1014 | struct serial_struct tmp; | 1014 | struct serial_struct tmp; |
@@ -1017,10 +1017,8 @@ static int get_serial_info(struct serial_state *state, | |||
1017 | return -EFAULT; | 1017 | return -EFAULT; |
1018 | memset(&tmp, 0, sizeof(tmp)); | 1018 | memset(&tmp, 0, sizeof(tmp)); |
1019 | tty_lock(); | 1019 | tty_lock(); |
1020 | tmp.type = state->type; | 1020 | tmp.line = tty->index; |
1021 | tmp.line = state->line; | ||
1022 | tmp.port = state->port; | 1021 | tmp.port = state->port; |
1023 | tmp.irq = state->irq; | ||
1024 | tmp.flags = state->tport.flags; | 1022 | tmp.flags = state->tport.flags; |
1025 | tmp.xmit_fifo_size = state->xmit_fifo_size; | 1023 | tmp.xmit_fifo_size = state->xmit_fifo_size; |
1026 | tmp.baud_base = state->baud_base; | 1024 | tmp.baud_base = state->baud_base; |
@@ -1047,7 +1045,7 @@ static int set_serial_info(struct tty_struct *tty, struct serial_state *state, | |||
1047 | tty_lock(); | 1045 | tty_lock(); |
1048 | change_spd = ((new_serial.flags ^ port->flags) & ASYNC_SPD_MASK) || | 1046 | change_spd = ((new_serial.flags ^ port->flags) & ASYNC_SPD_MASK) || |
1049 | new_serial.custom_divisor != state->custom_divisor; | 1047 | new_serial.custom_divisor != state->custom_divisor; |
1050 | if (new_serial.irq != state->irq || new_serial.port != state->port || | 1048 | if (new_serial.irq || new_serial.port != state->port || |
1051 | new_serial.xmit_fifo_size != state->xmit_fifo_size) { | 1049 | new_serial.xmit_fifo_size != state->xmit_fifo_size) { |
1052 | tty_unlock(); | 1050 | tty_unlock(); |
1053 | return -EINVAL; | 1051 | return -EINVAL; |
@@ -1250,7 +1248,7 @@ static int rs_ioctl(struct tty_struct *tty, | |||
1250 | 1248 | ||
1251 | switch (cmd) { | 1249 | switch (cmd) { |
1252 | case TIOCGSERIAL: | 1250 | case TIOCGSERIAL: |
1253 | return get_serial_info(info, argp); | 1251 | return get_serial_info(tty, info, argp); |
1254 | case TIOCSSERIAL: | 1252 | case TIOCSSERIAL: |
1255 | return set_serial_info(tty, info, argp); | 1253 | return set_serial_info(tty, info, argp); |
1256 | case TIOCSERCONFIG: | 1254 | case TIOCSERCONFIG: |
@@ -1403,7 +1401,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp) | |||
1403 | } | 1401 | } |
1404 | if (--port->count < 0) { | 1402 | if (--port->count < 0) { |
1405 | printk("rs_close: bad serial port count for ttys%d: %d\n", | 1403 | printk("rs_close: bad serial port count for ttys%d: %d\n", |
1406 | state->line, port->count); | 1404 | tty->index, port->count); |
1407 | port->count = 0; | 1405 | port->count = 0; |
1408 | } | 1406 | } |
1409 | if (port->count) { | 1407 | if (port->count) { |
@@ -1720,12 +1718,13 @@ static int rs_open(struct tty_struct *tty, struct file * filp) | |||
1720 | * /proc fs routines.... | 1718 | * /proc fs routines.... |
1721 | */ | 1719 | */ |
1722 | 1720 | ||
1723 | static inline void line_info(struct seq_file *m, struct serial_state *state) | 1721 | static inline void line_info(struct seq_file *m, int line, |
1722 | struct serial_state *state) | ||
1724 | { | 1723 | { |
1725 | char stat_buf[30], control, status; | 1724 | char stat_buf[30], control, status; |
1726 | unsigned long flags; | 1725 | unsigned long flags; |
1727 | 1726 | ||
1728 | seq_printf(m, "%d: uart:amiga_builtin",state->line); | 1727 | seq_printf(m, "%d: uart:amiga_builtin", line); |
1729 | 1728 | ||
1730 | local_irq_save(flags); | 1729 | local_irq_save(flags); |
1731 | status = ciab.pra; | 1730 | status = ciab.pra; |
@@ -1771,7 +1770,7 @@ static inline void line_info(struct seq_file *m, struct serial_state *state) | |||
1771 | static int rs_proc_show(struct seq_file *m, void *v) | 1770 | static int rs_proc_show(struct seq_file *m, void *v) |
1772 | { | 1771 | { |
1773 | seq_printf(m, "serinfo:1.0 driver:%s\n", serial_version); | 1772 | seq_printf(m, "serinfo:1.0 driver:%s\n", serial_version); |
1774 | line_info(m, &rs_table[0]); | 1773 | line_info(m, 0, &rs_table[0]); |
1775 | return 0; | 1774 | return 0; |
1776 | } | 1775 | } |
1777 | 1776 | ||
@@ -1867,7 +1866,6 @@ static int __init amiga_serial_probe(struct platform_device *pdev) | |||
1867 | 1866 | ||
1868 | state = rs_table; | 1867 | state = rs_table; |
1869 | state->port = (int)&custom.serdatr; /* Just to give it a value */ | 1868 | state->port = (int)&custom.serdatr; /* Just to give it a value */ |
1870 | state->line = 0; | ||
1871 | state->custom_divisor = 0; | 1869 | state->custom_divisor = 0; |
1872 | state->icount.cts = state->icount.dsr = | 1870 | state->icount.cts = state->icount.dsr = |
1873 | state->icount.rng = state->icount.dcd = 0; | 1871 | state->icount.rng = state->icount.dcd = 0; |
@@ -1876,8 +1874,7 @@ static int __init amiga_serial_probe(struct platform_device *pdev) | |||
1876 | state->icount.overrun = state->icount.brk = 0; | 1874 | state->icount.overrun = state->icount.brk = 0; |
1877 | tty_port_init(&state->tport); | 1875 | tty_port_init(&state->tport); |
1878 | 1876 | ||
1879 | printk(KERN_INFO "ttyS%d is the amiga builtin serial port\n", | 1877 | printk(KERN_INFO "ttyS0 is the amiga builtin serial port\n"); |
1880 | state->line); | ||
1881 | 1878 | ||
1882 | /* Hardware set up */ | 1879 | /* Hardware set up */ |
1883 | 1880 | ||
diff --git a/include/linux/serialP.h b/include/linux/serialP.h index 9a04dec1589a..77afbdb134ae 100644 --- a/include/linux/serialP.h +++ b/include/linux/serialP.h | |||
@@ -29,9 +29,6 @@ | |||
29 | struct serial_state { | 29 | struct serial_state { |
30 | int baud_base; | 30 | int baud_base; |
31 | unsigned long port; | 31 | unsigned long port; |
32 | int irq; | ||
33 | int type; | ||
34 | int line; | ||
35 | int xmit_fifo_size; | 32 | int xmit_fifo_size; |
36 | int custom_divisor; | 33 | int custom_divisor; |
37 | struct async_icount icount; | 34 | struct async_icount icount; |