aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/8250.c
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2012-01-26 12:44:09 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2012-01-26 20:14:50 -0500
commitd4e33fac2408d37f7b52e80ca2a89f9fb482914f (patch)
treedd25baa1bc251ad2aa61a07eda7f95a4d7094126 /drivers/tty/serial/8250.c
parent3afbd89c9639c344300dcdd7d4e5e18dda559fd4 (diff)
serial: Kill off NO_IRQ
We transform the offenders into a test of irq <= 0 which will be ok while the ARM people get their platform sorted. Once that is done (or in a while if they don't do it anyway) then we will change them all to !irq checks. For arch specific drivers that are already using NO_IRQ = 0 we just test against zero so we don't need to re-review them later. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/tty/serial/8250.c')
-rw-r--r--drivers/tty/serial/8250.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
index 9f50c4e3c2b..b0eb9613932 100644
--- a/drivers/tty/serial/8250.c
+++ b/drivers/tty/serial/8250.c
@@ -86,13 +86,6 @@ static unsigned int skip_txen_test; /* force skip of txen test at init time */
86#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) 86#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)
87 87
88 88
89/*
90 * We default to IRQ0 for the "no irq" hack. Some
91 * machine types want others as well - they're free
92 * to redefine this in their header file.
93 */
94#define is_real_interrupt(irq) ((irq) != 0)
95
96#ifdef CONFIG_SERIAL_8250_DETECT_IRQ 89#ifdef CONFIG_SERIAL_8250_DETECT_IRQ
97#define CONFIG_SERIAL_DETECT_IRQ 1 90#define CONFIG_SERIAL_DETECT_IRQ 1
98#endif 91#endif
@@ -1750,7 +1743,7 @@ static void serial8250_backup_timeout(unsigned long data)
1750 * Must disable interrupts or else we risk racing with the interrupt 1743 * Must disable interrupts or else we risk racing with the interrupt
1751 * based handler. 1744 * based handler.
1752 */ 1745 */
1753 if (is_real_interrupt(up->port.irq)) { 1746 if (up->port.irq) {
1754 ier = serial_in(up, UART_IER); 1747 ier = serial_in(up, UART_IER);
1755 serial_out(up, UART_IER, 0); 1748 serial_out(up, UART_IER, 0);
1756 } 1749 }
@@ -1775,7 +1768,7 @@ static void serial8250_backup_timeout(unsigned long data)
1775 if (!(iir & UART_IIR_NO_INT)) 1768 if (!(iir & UART_IIR_NO_INT))
1776 serial8250_tx_chars(up); 1769 serial8250_tx_chars(up);
1777 1770
1778 if (is_real_interrupt(up->port.irq)) 1771 if (up->port.irq)
1779 serial_out(up, UART_IER, ier); 1772 serial_out(up, UART_IER, ier);
1780 1773
1781 spin_unlock_irqrestore(&up->port.lock, flags); 1774 spin_unlock_irqrestore(&up->port.lock, flags);
@@ -2028,7 +2021,7 @@ static int serial8250_startup(struct uart_port *port)
2028 serial_outp(up, UART_LCR, 0); 2021 serial_outp(up, UART_LCR, 0);
2029 } 2022 }
2030 2023
2031 if (is_real_interrupt(up->port.irq)) { 2024 if (up->port.irq) {
2032 unsigned char iir1; 2025 unsigned char iir1;
2033 /* 2026 /*
2034 * Test for UARTs that do not reassert THRE when the 2027 * Test for UARTs that do not reassert THRE when the
@@ -2083,7 +2076,7 @@ static int serial8250_startup(struct uart_port *port)
2083 * hardware interrupt, we use a timer-based system. The original 2076 * hardware interrupt, we use a timer-based system. The original
2084 * driver used to do this with IRQ0. 2077 * driver used to do this with IRQ0.
2085 */ 2078 */
2086 if (!is_real_interrupt(up->port.irq)) { 2079 if (!up->port.irq) {
2087 up->timer.data = (unsigned long)up; 2080 up->timer.data = (unsigned long)up;
2088 mod_timer(&up->timer, jiffies + uart_poll_timeout(port)); 2081 mod_timer(&up->timer, jiffies + uart_poll_timeout(port));
2089 } else { 2082 } else {
@@ -2099,13 +2092,13 @@ static int serial8250_startup(struct uart_port *port)
2099 2092
2100 spin_lock_irqsave(&up->port.lock, flags); 2093 spin_lock_irqsave(&up->port.lock, flags);
2101 if (up->port.flags & UPF_FOURPORT) { 2094 if (up->port.flags & UPF_FOURPORT) {
2102 if (!is_real_interrupt(up->port.irq)) 2095 if (!up->port.irq)
2103 up->port.mctrl |= TIOCM_OUT1; 2096 up->port.mctrl |= TIOCM_OUT1;
2104 } else 2097 } else
2105 /* 2098 /*
2106 * Most PC uarts need OUT2 raised to enable interrupts. 2099 * Most PC uarts need OUT2 raised to enable interrupts.
2107 */ 2100 */
2108 if (is_real_interrupt(up->port.irq)) 2101 if (up->port.irq)
2109 up->port.mctrl |= TIOCM_OUT2; 2102 up->port.mctrl |= TIOCM_OUT2;
2110 2103
2111 serial8250_set_mctrl(&up->port, up->port.mctrl); 2104 serial8250_set_mctrl(&up->port, up->port.mctrl);
@@ -2223,7 +2216,7 @@ static void serial8250_shutdown(struct uart_port *port)
2223 2216
2224 del_timer_sync(&up->timer); 2217 del_timer_sync(&up->timer);
2225 up->timer.function = serial8250_timeout; 2218 up->timer.function = serial8250_timeout;
2226 if (is_real_interrupt(up->port.irq)) 2219 if (up->port.irq)
2227 serial_unlink_irq_chain(up); 2220 serial_unlink_irq_chain(up);
2228} 2221}
2229 2222