diff options
author | Jiri Slaby <jslaby@suse.cz> | 2012-03-05 08:52:12 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-03-08 14:48:42 -0500 |
commit | 9c8efecc91c02056340ae19612315f3225e6dbe2 (patch) | |
tree | 4702bd81b36848f572e341e057c21fb91bb5ad5e | |
parent | 3ee0017e03cd790ed1adaa97ef6f99aff3706ec2 (diff) |
TTY: serialP, remove unused material
First, remove unused macro and rs_multiport_struct structure. Nobody
uses them at all.
Further, the 2 drivers (they are below) which use the rest of
structures from serialP.h (async_struct and serial_state) do not use
all the members. Remove the members:
* which are unused or
* which are only initialized and never used for something real.
Everybody should avoid the structures with a looong distance.
Finally, remove the ALPHA kludge MCR quirks. They are 1:1 copy from
8250.h. No need to redefine them here.
The 2 promised users of the structures:
arch/ia64/hp/sim/simserial.c
drivers/tty/amiserial.c
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | arch/ia64/hp/sim/simserial.c | 10 | ||||
-rw-r--r-- | drivers/tty/amiserial.c | 6 | ||||
-rw-r--r-- | include/linux/serialP.h | 59 |
3 files changed, 1 insertions, 74 deletions
diff --git a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c index 2a2fe0c56119..9890b58960a7 100644 --- a/arch/ia64/hp/sim/simserial.c +++ b/arch/ia64/hp/sim/simserial.c | |||
@@ -72,7 +72,7 @@ static char *serial_version = "0.6"; | |||
72 | */ | 72 | */ |
73 | static struct serial_state rs_table[NR_PORTS]={ | 73 | static struct serial_state rs_table[NR_PORTS]={ |
74 | /* UART CLK PORT IRQ FLAGS */ | 74 | /* UART CLK PORT IRQ FLAGS */ |
75 | { 0, BASE_BAUD, 0x3F8, 0, STD_COM_FLAGS,0,PORT_16550 } /* ttyS0 */ | 75 | { BASE_BAUD, 0x3F8, 0, STD_COM_FLAGS, PORT_16550 } /* ttyS0 */ |
76 | }; | 76 | }; |
77 | 77 | ||
78 | /* | 78 | /* |
@@ -194,11 +194,6 @@ static irqreturn_t rs_interrupt_single(int irq, void *dev_id) | |||
194 | * ------------------------------------------------------------------- | 194 | * ------------------------------------------------------------------- |
195 | */ | 195 | */ |
196 | 196 | ||
197 | static void do_softint(struct work_struct *private_) | ||
198 | { | ||
199 | printk(KERN_ERR "simserial: do_softint called\n"); | ||
200 | } | ||
201 | |||
202 | static int rs_put_char(struct tty_struct *tty, unsigned char ch) | 197 | static int rs_put_char(struct tty_struct *tty, unsigned char ch) |
203 | { | 198 | { |
204 | struct async_struct *info = (struct async_struct *)tty->driver_data; | 199 | struct async_struct *info = (struct async_struct *)tty->driver_data; |
@@ -641,13 +636,10 @@ static int get_async_struct(int line, struct async_struct **ret_info) | |||
641 | } | 636 | } |
642 | init_waitqueue_head(&info->open_wait); | 637 | init_waitqueue_head(&info->open_wait); |
643 | init_waitqueue_head(&info->close_wait); | 638 | init_waitqueue_head(&info->close_wait); |
644 | init_waitqueue_head(&info->delta_msr_wait); | ||
645 | info->magic = SERIAL_MAGIC; | ||
646 | info->port = sstate->port; | 639 | info->port = sstate->port; |
647 | info->flags = sstate->flags; | 640 | info->flags = sstate->flags; |
648 | info->xmit_fifo_size = sstate->xmit_fifo_size; | 641 | info->xmit_fifo_size = sstate->xmit_fifo_size; |
649 | info->line = line; | 642 | info->line = line; |
650 | INIT_WORK(&info->work, do_softint); | ||
651 | info->state = sstate; | 643 | info->state = sstate; |
652 | if (sstate->info) { | 644 | if (sstate->info) { |
653 | kfree(info); | 645 | kfree(info); |
diff --git a/drivers/tty/amiserial.c b/drivers/tty/amiserial.c index 753286257554..c6d8913dd6f6 100644 --- a/drivers/tty/amiserial.c +++ b/drivers/tty/amiserial.c | |||
@@ -473,7 +473,6 @@ static irqreturn_t ser_rx_int(int irq, void *dev_id) | |||
473 | return IRQ_NONE; | 473 | return IRQ_NONE; |
474 | 474 | ||
475 | receive_chars(info); | 475 | receive_chars(info); |
476 | info->last_active = jiffies; | ||
477 | #ifdef SERIAL_DEBUG_INTR | 476 | #ifdef SERIAL_DEBUG_INTR |
478 | printk("end.\n"); | 477 | printk("end.\n"); |
479 | #endif | 478 | #endif |
@@ -494,7 +493,6 @@ static irqreturn_t ser_tx_int(int irq, void *dev_id) | |||
494 | return IRQ_NONE; | 493 | return IRQ_NONE; |
495 | 494 | ||
496 | transmit_chars(info); | 495 | transmit_chars(info); |
497 | info->last_active = jiffies; | ||
498 | #ifdef SERIAL_DEBUG_INTR | 496 | #ifdef SERIAL_DEBUG_INTR |
499 | printk("end.\n"); | 497 | printk("end.\n"); |
500 | #endif | 498 | #endif |
@@ -828,7 +826,6 @@ static void change_speed(struct async_struct *info, | |||
828 | mb(); | 826 | mb(); |
829 | } | 827 | } |
830 | 828 | ||
831 | info->LCR = cval; /* Save LCR */ | ||
832 | local_irq_restore(flags); | 829 | local_irq_restore(flags); |
833 | } | 830 | } |
834 | 831 | ||
@@ -1743,7 +1740,6 @@ static int get_async_struct(int line, struct async_struct **ret_info) | |||
1743 | init_waitqueue_head(&info->close_wait); | 1740 | init_waitqueue_head(&info->close_wait); |
1744 | init_waitqueue_head(&info->delta_msr_wait); | 1741 | init_waitqueue_head(&info->delta_msr_wait); |
1745 | #endif | 1742 | #endif |
1746 | info->magic = SERIAL_MAGIC; | ||
1747 | info->port = sstate->port; | 1743 | info->port = sstate->port; |
1748 | info->flags = sstate->flags; | 1744 | info->flags = sstate->flags; |
1749 | info->xmit_fifo_size = sstate->xmit_fifo_size; | 1745 | info->xmit_fifo_size = sstate->xmit_fifo_size; |
@@ -1840,7 +1836,6 @@ static inline void line_info(struct seq_file *m, struct serial_state *state) | |||
1840 | if (!info) { | 1836 | if (!info) { |
1841 | info = &scr_info; /* This is just for serial_{in,out} */ | 1837 | info = &scr_info; /* This is just for serial_{in,out} */ |
1842 | 1838 | ||
1843 | info->magic = SERIAL_MAGIC; | ||
1844 | info->flags = state->flags; | 1839 | info->flags = state->flags; |
1845 | info->quot = 0; | 1840 | info->quot = 0; |
1846 | info->tty = NULL; | 1841 | info->tty = NULL; |
@@ -1987,7 +1982,6 @@ static int __init amiga_serial_probe(struct platform_device *pdev) | |||
1987 | goto fail_put_tty_driver; | 1982 | goto fail_put_tty_driver; |
1988 | 1983 | ||
1989 | state = rs_table; | 1984 | state = rs_table; |
1990 | state->magic = SSTATE_MAGIC; | ||
1991 | state->port = (int)&custom.serdatr; /* Just to give it a value */ | 1985 | state->port = (int)&custom.serdatr; /* Just to give it a value */ |
1992 | state->line = 0; | 1986 | state->line = 0; |
1993 | state->custom_divisor = 0; | 1987 | state->custom_divisor = 0; |
diff --git a/include/linux/serialP.h b/include/linux/serialP.h index ec27b34bbbd6..c1acdb2c8584 100644 --- a/include/linux/serialP.h +++ b/include/linux/serialP.h | |||
@@ -26,32 +26,23 @@ | |||
26 | #include <linux/wait.h> | 26 | #include <linux/wait.h> |
27 | 27 | ||
28 | struct serial_state { | 28 | struct serial_state { |
29 | int magic; | ||
30 | int baud_base; | 29 | int baud_base; |
31 | unsigned long port; | 30 | unsigned long port; |
32 | int irq; | 31 | int irq; |
33 | int flags; | 32 | int flags; |
34 | int hub6; | ||
35 | int type; | 33 | int type; |
36 | int line; | 34 | int line; |
37 | int revision; /* Chip revision (950) */ | ||
38 | int xmit_fifo_size; | 35 | int xmit_fifo_size; |
39 | int custom_divisor; | 36 | int custom_divisor; |
40 | int count; | 37 | int count; |
41 | u8 *iomem_base; | ||
42 | u16 iomem_reg_shift; | ||
43 | unsigned short close_delay; | 38 | unsigned short close_delay; |
44 | unsigned short closing_wait; /* time to wait before closing */ | 39 | unsigned short closing_wait; /* time to wait before closing */ |
45 | struct async_icount icount; | 40 | struct async_icount icount; |
46 | int io_type; | ||
47 | struct async_struct *info; | 41 | struct async_struct *info; |
48 | struct pci_dev *dev; | ||
49 | }; | 42 | }; |
50 | 43 | ||
51 | struct async_struct { | 44 | struct async_struct { |
52 | int magic; | ||
53 | unsigned long port; | 45 | unsigned long port; |
54 | int hub6; | ||
55 | int flags; | 46 | int flags; |
56 | int xmit_fifo_size; | 47 | int xmit_fifo_size; |
57 | struct serial_state *state; | 48 | struct serial_state *state; |
@@ -63,21 +54,12 @@ struct async_struct { | |||
63 | int x_char; /* xon/xoff character */ | 54 | int x_char; /* xon/xoff character */ |
64 | int close_delay; | 55 | int close_delay; |
65 | unsigned short closing_wait; | 56 | unsigned short closing_wait; |
66 | unsigned short closing_wait2; /* obsolete */ | ||
67 | int IER; /* Interrupt Enable Register */ | 57 | int IER; /* Interrupt Enable Register */ |
68 | int MCR; /* Modem control register */ | 58 | int MCR; /* Modem control register */ |
69 | int LCR; /* Line control register */ | ||
70 | int ACR; /* 16950 Additional Control Reg. */ | ||
71 | unsigned long event; | 59 | unsigned long event; |
72 | unsigned long last_active; | ||
73 | int line; | 60 | int line; |
74 | int blocked_open; /* # of blocked opens */ | 61 | int blocked_open; /* # of blocked opens */ |
75 | struct circ_buf xmit; | 62 | struct circ_buf xmit; |
76 | spinlock_t xmit_lock; | ||
77 | u8 *iomem_base; | ||
78 | u16 iomem_reg_shift; | ||
79 | int io_type; | ||
80 | struct work_struct work; | ||
81 | struct tasklet_struct tlet; | 63 | struct tasklet_struct tlet; |
82 | wait_queue_head_t open_wait; | 64 | wait_queue_head_t open_wait; |
83 | wait_queue_head_t close_wait; | 65 | wait_queue_head_t close_wait; |
@@ -86,51 +68,10 @@ struct async_struct { | |||
86 | struct async_struct *prev_port; | 68 | struct async_struct *prev_port; |
87 | }; | 69 | }; |
88 | 70 | ||
89 | #define CONFIGURED_SERIAL_PORT(info) ((info)->port || ((info)->iomem_base)) | ||
90 | |||
91 | #define SERIAL_MAGIC 0x5301 | ||
92 | #define SSTATE_MAGIC 0x5302 | ||
93 | |||
94 | /* | 71 | /* |
95 | * Events are used to schedule things to happen at timer-interrupt | 72 | * Events are used to schedule things to happen at timer-interrupt |
96 | * time, instead of at rs interrupt time. | 73 | * time, instead of at rs interrupt time. |
97 | */ | 74 | */ |
98 | #define RS_EVENT_WRITE_WAKEUP 0 | 75 | #define RS_EVENT_WRITE_WAKEUP 0 |
99 | 76 | ||
100 | /* | ||
101 | * Multiport serial configuration structure --- internal structure | ||
102 | */ | ||
103 | struct rs_multiport_struct { | ||
104 | int port1; | ||
105 | unsigned char mask1, match1; | ||
106 | int port2; | ||
107 | unsigned char mask2, match2; | ||
108 | int port3; | ||
109 | unsigned char mask3, match3; | ||
110 | int port4; | ||
111 | unsigned char mask4, match4; | ||
112 | int port_monitor; | ||
113 | }; | ||
114 | |||
115 | #if defined(__alpha__) && !defined(CONFIG_PCI) | ||
116 | /* | ||
117 | * Digital did something really horribly wrong with the OUT1 and OUT2 | ||
118 | * lines on at least some ALPHA's. The failure mode is that if either | ||
119 | * is cleared, the machine locks up with endless interrupts. | ||
120 | * | ||
121 | * This is still used by arch/mips/au1000/common/serial.c for some weird | ||
122 | * reason (mips != alpha!) | ||
123 | */ | ||
124 | #define ALPHA_KLUDGE_MCR (UART_MCR_OUT2 | UART_MCR_OUT1) | ||
125 | #elif defined(CONFIG_SBC8560) | ||
126 | /* | ||
127 | * WindRiver did something similarly broken on their SBC8560 board. The | ||
128 | * UART tristates its IRQ output while OUT2 is clear, but they pulled | ||
129 | * the interrupt line _up_ instead of down, so if we register the IRQ | ||
130 | * while the UART is in that state, we die in an IRQ storm. */ | ||
131 | #define ALPHA_KLUDGE_MCR (UART_MCR_OUT2) | ||
132 | #else | ||
133 | #define ALPHA_KLUDGE_MCR 0 | ||
134 | #endif | ||
135 | |||
136 | #endif /* _LINUX_SERIAL_H */ | 77 | #endif /* _LINUX_SERIAL_H */ |