aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r--drivers/tty/serial/21285.c4
-rw-r--r--drivers/tty/serial/8250.c21
-rw-r--r--drivers/tty/serial/m32r_sio.c11
-rw-r--r--drivers/tty/serial/mpc52xx_uart.c4
-rw-r--r--drivers/tty/serial/mux.c2
-rw-r--r--drivers/tty/serial/pmac_zilog.c2
-rw-r--r--drivers/tty/serial/sunzilog.c10
-rw-r--r--drivers/tty/serial/ucc_uart.c2
-rw-r--r--drivers/tty/serial/vr41xx_siu.c4
9 files changed, 23 insertions, 37 deletions
diff --git a/drivers/tty/serial/21285.c b/drivers/tty/serial/21285.c
index 1b37626e8f13..f899996b4363 100644
--- a/drivers/tty/serial/21285.c
+++ b/drivers/tty/serial/21285.c
@@ -331,7 +331,7 @@ static int serial21285_verify_port(struct uart_port *port, struct serial_struct
331 int ret = 0; 331 int ret = 0;
332 if (ser->type != PORT_UNKNOWN && ser->type != PORT_21285) 332 if (ser->type != PORT_UNKNOWN && ser->type != PORT_21285)
333 ret = -EINVAL; 333 ret = -EINVAL;
334 if (ser->irq != NO_IRQ) 334 if (ser->irq <= 0)
335 ret = -EINVAL; 335 ret = -EINVAL;
336 if (ser->baud_base != port->uartclk / 16) 336 if (ser->baud_base != port->uartclk / 16)
337 ret = -EINVAL; 337 ret = -EINVAL;
@@ -360,7 +360,7 @@ static struct uart_ops serial21285_ops = {
360static struct uart_port serial21285_port = { 360static struct uart_port serial21285_port = {
361 .mapbase = 0x42000160, 361 .mapbase = 0x42000160,
362 .iotype = UPIO_MEM, 362 .iotype = UPIO_MEM,
363 .irq = NO_IRQ, 363 .irq = 0,
364 .fifosize = 16, 364 .fifosize = 16,
365 .ops = &serial21285_ops, 365 .ops = &serial21285_ops,
366 .flags = UPF_BOOT_AUTOCONF, 366 .flags = UPF_BOOT_AUTOCONF,
diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
index 9f50c4e3c2be..b0eb96139324 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
diff --git a/drivers/tty/serial/m32r_sio.c b/drivers/tty/serial/m32r_sio.c
index 94a6792bf97b..e465dda63edf 100644
--- a/drivers/tty/serial/m32r_sio.c
+++ b/drivers/tty/serial/m32r_sio.c
@@ -70,13 +70,6 @@
70 70
71#define PASS_LIMIT 256 71#define PASS_LIMIT 256
72 72
73/*
74 * We default to IRQ0 for the "no irq" hack. Some
75 * machine types want others as well - they're free
76 * to redefine this in their header file.
77 */
78#define is_real_interrupt(irq) ((irq) != 0)
79
80#define BASE_BAUD 115200 73#define BASE_BAUD 115200
81 74
82/* Standard COM flags */ 75/* Standard COM flags */
@@ -640,7 +633,7 @@ static int m32r_sio_startup(struct uart_port *port)
640 * hardware interrupt, we use a timer-based system. The original 633 * hardware interrupt, we use a timer-based system. The original
641 * driver used to do this with IRQ0. 634 * driver used to do this with IRQ0.
642 */ 635 */
643 if (!is_real_interrupt(up->port.irq)) { 636 if (!up->port.irq) {
644 unsigned int timeout = up->port.timeout; 637 unsigned int timeout = up->port.timeout;
645 638
646 timeout = timeout > 6 ? (timeout / 2 - 2) : 1; 639 timeout = timeout > 6 ? (timeout / 2 - 2) : 1;
@@ -687,7 +680,7 @@ static void m32r_sio_shutdown(struct uart_port *port)
687 680
688 sio_init(); 681 sio_init();
689 682
690 if (!is_real_interrupt(up->port.irq)) 683 if (!up->port.irq)
691 del_timer_sync(&up->timer); 684 del_timer_sync(&up->timer);
692 else 685 else
693 serial_unlink_irq_chain(up); 686 serial_unlink_irq_chain(up);
diff --git a/drivers/tty/serial/mpc52xx_uart.c b/drivers/tty/serial/mpc52xx_uart.c
index 1093a88a1fe3..e9a770d77a6e 100644
--- a/drivers/tty/serial/mpc52xx_uart.c
+++ b/drivers/tty/serial/mpc52xx_uart.c
@@ -507,7 +507,7 @@ static int __init mpc512x_psc_fifoc_init(void)
507 507
508 psc_fifoc_irq = irq_of_parse_and_map(np, 0); 508 psc_fifoc_irq = irq_of_parse_and_map(np, 0);
509 of_node_put(np); 509 of_node_put(np);
510 if (psc_fifoc_irq == NO_IRQ) { 510 if (psc_fifoc_irq == 0) {
511 pr_err("%s: Can't get FIFOC irq\n", __func__); 511 pr_err("%s: Can't get FIFOC irq\n", __func__);
512 iounmap(psc_fifoc); 512 iounmap(psc_fifoc);
513 return -ENODEV; 513 return -ENODEV;
@@ -1354,7 +1354,7 @@ static int __devinit mpc52xx_uart_of_probe(struct platform_device *op)
1354 } 1354 }
1355 1355
1356 psc_ops->get_irq(port, op->dev.of_node); 1356 psc_ops->get_irq(port, op->dev.of_node);
1357 if (port->irq == NO_IRQ) { 1357 if (port->irq == 0) {
1358 dev_dbg(&op->dev, "Could not get irq\n"); 1358 dev_dbg(&op->dev, "Could not get irq\n");
1359 return -EINVAL; 1359 return -EINVAL;
1360 } 1360 }
diff --git a/drivers/tty/serial/mux.c b/drivers/tty/serial/mux.c
index 06f6aefd5ba6..c61d950e07c1 100644
--- a/drivers/tty/serial/mux.c
+++ b/drivers/tty/serial/mux.c
@@ -499,7 +499,7 @@ static int __init mux_probe(struct parisc_device *dev)
499 port->membase = ioremap_nocache(port->mapbase, MUX_LINE_OFFSET); 499 port->membase = ioremap_nocache(port->mapbase, MUX_LINE_OFFSET);
500 port->iotype = UPIO_MEM; 500 port->iotype = UPIO_MEM;
501 port->type = PORT_MUX; 501 port->type = PORT_MUX;
502 port->irq = NO_IRQ; 502 port->irq = 0;
503 port->uartclk = 0; 503 port->uartclk = 0;
504 port->fifosize = MUX_FIFO_SIZE; 504 port->fifosize = MUX_FIFO_SIZE;
505 port->ops = &mux_pops; 505 port->ops = &mux_pops;
diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c
index e9c2dfe471a2..08ebe901bb59 100644
--- a/drivers/tty/serial/pmac_zilog.c
+++ b/drivers/tty/serial/pmac_zilog.c
@@ -1506,7 +1506,7 @@ no_dma:
1506 * fixed up interrupt info, but we use the device-tree directly 1506 * fixed up interrupt info, but we use the device-tree directly
1507 * here due to early probing so we need the fixup too. 1507 * here due to early probing so we need the fixup too.
1508 */ 1508 */
1509 if (uap->port.irq == NO_IRQ && 1509 if (uap->port.irq == 0 &&
1510 np->parent && np->parent->parent && 1510 np->parent && np->parent->parent &&
1511 of_device_is_compatible(np->parent->parent, "gatwick")) { 1511 of_device_is_compatible(np->parent->parent, "gatwick")) {
1512 /* IRQs on gatwick are offset by 64 */ 1512 /* IRQs on gatwick are offset by 64 */
diff --git a/drivers/tty/serial/sunzilog.c b/drivers/tty/serial/sunzilog.c
index 8e916e76b7b5..5a47d1b196d8 100644
--- a/drivers/tty/serial/sunzilog.c
+++ b/drivers/tty/serial/sunzilog.c
@@ -1397,7 +1397,7 @@ static void __devinit sunzilog_init_hw(struct uart_sunzilog_port *up)
1397#endif 1397#endif
1398} 1398}
1399 1399
1400static int zilog_irq = -1; 1400static int zilog_irq;
1401 1401
1402static int __devinit zs_probe(struct platform_device *op) 1402static int __devinit zs_probe(struct platform_device *op)
1403{ 1403{
@@ -1425,7 +1425,7 @@ static int __devinit zs_probe(struct platform_device *op)
1425 1425
1426 rp = sunzilog_chip_regs[inst]; 1426 rp = sunzilog_chip_regs[inst];
1427 1427
1428 if (zilog_irq == -1) 1428 if (!zilog_irq)
1429 zilog_irq = op->archdata.irqs[0]; 1429 zilog_irq = op->archdata.irqs[0];
1430 1430
1431 up = &sunzilog_port_table[inst * 2]; 1431 up = &sunzilog_port_table[inst * 2];
@@ -1580,7 +1580,7 @@ static int __init sunzilog_init(void)
1580 if (err) 1580 if (err)
1581 goto out_unregister_uart; 1581 goto out_unregister_uart;
1582 1582
1583 if (zilog_irq != -1) { 1583 if (!zilog_irq) {
1584 struct uart_sunzilog_port *up = sunzilog_irq_chain; 1584 struct uart_sunzilog_port *up = sunzilog_irq_chain;
1585 err = request_irq(zilog_irq, sunzilog_interrupt, IRQF_SHARED, 1585 err = request_irq(zilog_irq, sunzilog_interrupt, IRQF_SHARED,
1586 "zs", sunzilog_irq_chain); 1586 "zs", sunzilog_irq_chain);
@@ -1621,7 +1621,7 @@ static void __exit sunzilog_exit(void)
1621{ 1621{
1622 platform_driver_unregister(&zs_driver); 1622 platform_driver_unregister(&zs_driver);
1623 1623
1624 if (zilog_irq != -1) { 1624 if (!zilog_irq) {
1625 struct uart_sunzilog_port *up = sunzilog_irq_chain; 1625 struct uart_sunzilog_port *up = sunzilog_irq_chain;
1626 1626
1627 /* Disable Interrupts */ 1627 /* Disable Interrupts */
@@ -1637,7 +1637,7 @@ static void __exit sunzilog_exit(void)
1637 } 1637 }
1638 1638
1639 free_irq(zilog_irq, sunzilog_irq_chain); 1639 free_irq(zilog_irq, sunzilog_irq_chain);
1640 zilog_irq = -1; 1640 zilog_irq = 0;
1641 } 1641 }
1642 1642
1643 if (sunzilog_reg.nr) { 1643 if (sunzilog_reg.nr) {
diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c
index 2ebe606a2db1..f99b0c965f85 100644
--- a/drivers/tty/serial/ucc_uart.c
+++ b/drivers/tty/serial/ucc_uart.c
@@ -1360,7 +1360,7 @@ static int ucc_uart_probe(struct platform_device *ofdev)
1360 } 1360 }
1361 1361
1362 qe_port->port.irq = irq_of_parse_and_map(np, 0); 1362 qe_port->port.irq = irq_of_parse_and_map(np, 0);
1363 if (qe_port->port.irq == NO_IRQ) { 1363 if (qe_port->port.irq == 0) {
1364 dev_err(&ofdev->dev, "could not map IRQ for UCC%u\n", 1364 dev_err(&ofdev->dev, "could not map IRQ for UCC%u\n",
1365 qe_port->ucc_num + 1); 1365 qe_port->ucc_num + 1);
1366 ret = -EINVAL; 1366 ret = -EINVAL;
diff --git a/drivers/tty/serial/vr41xx_siu.c b/drivers/tty/serial/vr41xx_siu.c
index 83148e79ca13..cf0d9485ec08 100644
--- a/drivers/tty/serial/vr41xx_siu.c
+++ b/drivers/tty/serial/vr41xx_siu.c
@@ -61,7 +61,7 @@
61static struct uart_port siu_uart_ports[SIU_PORTS_MAX] = { 61static struct uart_port siu_uart_ports[SIU_PORTS_MAX] = {
62 [0 ... SIU_PORTS_MAX-1] = { 62 [0 ... SIU_PORTS_MAX-1] = {
63 .lock = __SPIN_LOCK_UNLOCKED(siu_uart_ports->lock), 63 .lock = __SPIN_LOCK_UNLOCKED(siu_uart_ports->lock),
64 .irq = -1, 64 .irq = 0,
65 }, 65 },
66}; 66};
67 67
@@ -171,7 +171,7 @@ static inline unsigned int siu_check_type(struct uart_port *port)
171{ 171{
172 if (port->line == 0) 172 if (port->line == 0)
173 return PORT_VR41XX_SIU; 173 return PORT_VR41XX_SIU;
174 if (port->line == 1 && port->irq != -1) 174 if (port->line == 1 && port->irq)
175 return PORT_VR41XX_DSIU; 175 return PORT_VR41XX_DSIU;
176 176
177 return PORT_UNKNOWN; 177 return PORT_UNKNOWN;