提交 d4e33fac 编写于 作者: A Alan Cox 提交者: Greg Kroah-Hartman

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: NAlan Cox <alan@linux.intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 3afbd89c
...@@ -113,7 +113,7 @@ static int __init hvc_beat_init(void) ...@@ -113,7 +113,7 @@ static int __init hvc_beat_init(void)
if (!firmware_has_feature(FW_FEATURE_BEAT)) if (!firmware_has_feature(FW_FEATURE_BEAT))
return -ENODEV; return -ENODEV;
hp = hvc_alloc(0, NO_IRQ, &hvc_beat_get_put_ops, 16); hp = hvc_alloc(0, 0, &hvc_beat_get_put_ops, 16);
if (IS_ERR(hp)) if (IS_ERR(hp))
return PTR_ERR(hp); return PTR_ERR(hp);
hvc_beat_dev = hp; hvc_beat_dev = hp;
......
...@@ -94,7 +94,7 @@ static int __init hvc_rtas_init(void) ...@@ -94,7 +94,7 @@ static int __init hvc_rtas_init(void)
/* Allocate an hvc_struct for the console device we instantiated /* Allocate an hvc_struct for the console device we instantiated
* earlier. Save off hp so that we can return it on exit */ * earlier. Save off hp so that we can return it on exit */
hp = hvc_alloc(hvc_rtas_cookie, NO_IRQ, &hvc_rtas_get_put_ops, 16); hp = hvc_alloc(hvc_rtas_cookie, 0, &hvc_rtas_get_put_ops, 16);
if (IS_ERR(hp)) if (IS_ERR(hp))
return PTR_ERR(hp); return PTR_ERR(hp);
......
...@@ -69,7 +69,7 @@ static int __init hvc_udbg_init(void) ...@@ -69,7 +69,7 @@ static int __init hvc_udbg_init(void)
BUG_ON(hvc_udbg_dev); BUG_ON(hvc_udbg_dev);
hp = hvc_alloc(0, NO_IRQ, &hvc_udbg_ops, 16); hp = hvc_alloc(0, 0, &hvc_udbg_ops, 16);
if (IS_ERR(hp)) if (IS_ERR(hp))
return PTR_ERR(hp); return PTR_ERR(hp);
......
...@@ -176,7 +176,7 @@ static int __init xen_hvc_init(void) ...@@ -176,7 +176,7 @@ static int __init xen_hvc_init(void)
xencons_irq = bind_evtchn_to_irq(xen_start_info->console.domU.evtchn); xencons_irq = bind_evtchn_to_irq(xen_start_info->console.domU.evtchn);
} }
if (xencons_irq < 0) if (xencons_irq < 0)
xencons_irq = 0; /* NO_IRQ */ xencons_irq = 0;
else else
irq_set_noprobe(xencons_irq); irq_set_noprobe(xencons_irq);
......
...@@ -1203,7 +1203,7 @@ static void hvcs_close(struct tty_struct *tty, struct file *filp) ...@@ -1203,7 +1203,7 @@ static void hvcs_close(struct tty_struct *tty, struct file *filp)
{ {
struct hvcs_struct *hvcsd; struct hvcs_struct *hvcsd;
unsigned long flags; unsigned long flags;
int irq = NO_IRQ; int irq;
/* /*
* Is someone trying to close the file associated with this device after * Is someone trying to close the file associated with this device after
...@@ -1264,7 +1264,7 @@ static void hvcs_hangup(struct tty_struct * tty) ...@@ -1264,7 +1264,7 @@ static void hvcs_hangup(struct tty_struct * tty)
struct hvcs_struct *hvcsd = tty->driver_data; struct hvcs_struct *hvcsd = tty->driver_data;
unsigned long flags; unsigned long flags;
int temp_open_count; int temp_open_count;
int irq = NO_IRQ; int irq;
spin_lock_irqsave(&hvcsd->lock, flags); spin_lock_irqsave(&hvcsd->lock, flags);
/* Preserve this so that we know how many kref refs to put */ /* Preserve this so that we know how many kref refs to put */
......
...@@ -1237,7 +1237,7 @@ static int __init hvsi_console_init(void) ...@@ -1237,7 +1237,7 @@ static int __init hvsi_console_init(void)
hp->state = HVSI_CLOSED; hp->state = HVSI_CLOSED;
hp->vtermno = *vtermno; hp->vtermno = *vtermno;
hp->virq = irq_create_mapping(NULL, irq[0]); hp->virq = irq_create_mapping(NULL, irq[0]);
if (hp->virq == NO_IRQ) { if (hp->virq == 0) {
printk(KERN_ERR "%s: couldn't create irq mapping for 0x%x\n", printk(KERN_ERR "%s: couldn't create irq mapping for 0x%x\n",
__func__, irq[0]); __func__, irq[0]);
continue; continue;
......
...@@ -331,7 +331,7 @@ static int serial21285_verify_port(struct uart_port *port, struct serial_struct ...@@ -331,7 +331,7 @@ static int serial21285_verify_port(struct uart_port *port, struct serial_struct
int ret = 0; int ret = 0;
if (ser->type != PORT_UNKNOWN && ser->type != PORT_21285) if (ser->type != PORT_UNKNOWN && ser->type != PORT_21285)
ret = -EINVAL; ret = -EINVAL;
if (ser->irq != NO_IRQ) if (ser->irq <= 0)
ret = -EINVAL; ret = -EINVAL;
if (ser->baud_base != port->uartclk / 16) if (ser->baud_base != port->uartclk / 16)
ret = -EINVAL; ret = -EINVAL;
...@@ -360,7 +360,7 @@ static struct uart_ops serial21285_ops = { ...@@ -360,7 +360,7 @@ static struct uart_ops serial21285_ops = {
static struct uart_port serial21285_port = { static struct uart_port serial21285_port = {
.mapbase = 0x42000160, .mapbase = 0x42000160,
.iotype = UPIO_MEM, .iotype = UPIO_MEM,
.irq = NO_IRQ, .irq = 0,
.fifosize = 16, .fifosize = 16,
.ops = &serial21285_ops, .ops = &serial21285_ops,
.flags = UPF_BOOT_AUTOCONF, .flags = UPF_BOOT_AUTOCONF,
......
...@@ -86,13 +86,6 @@ static unsigned int skip_txen_test; /* force skip of txen test at init time */ ...@@ -86,13 +86,6 @@ static unsigned int skip_txen_test; /* force skip of txen test at init time */
#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)
/*
* We default to IRQ0 for the "no irq" hack. Some
* machine types want others as well - they're free
* to redefine this in their header file.
*/
#define is_real_interrupt(irq) ((irq) != 0)
#ifdef CONFIG_SERIAL_8250_DETECT_IRQ #ifdef CONFIG_SERIAL_8250_DETECT_IRQ
#define CONFIG_SERIAL_DETECT_IRQ 1 #define CONFIG_SERIAL_DETECT_IRQ 1
#endif #endif
...@@ -1750,7 +1743,7 @@ static void serial8250_backup_timeout(unsigned long data) ...@@ -1750,7 +1743,7 @@ static void serial8250_backup_timeout(unsigned long data)
* Must disable interrupts or else we risk racing with the interrupt * Must disable interrupts or else we risk racing with the interrupt
* based handler. * based handler.
*/ */
if (is_real_interrupt(up->port.irq)) { if (up->port.irq) {
ier = serial_in(up, UART_IER); ier = serial_in(up, UART_IER);
serial_out(up, UART_IER, 0); serial_out(up, UART_IER, 0);
} }
...@@ -1775,7 +1768,7 @@ static void serial8250_backup_timeout(unsigned long data) ...@@ -1775,7 +1768,7 @@ static void serial8250_backup_timeout(unsigned long data)
if (!(iir & UART_IIR_NO_INT)) if (!(iir & UART_IIR_NO_INT))
serial8250_tx_chars(up); serial8250_tx_chars(up);
if (is_real_interrupt(up->port.irq)) if (up->port.irq)
serial_out(up, UART_IER, ier); serial_out(up, UART_IER, ier);
spin_unlock_irqrestore(&up->port.lock, flags); spin_unlock_irqrestore(&up->port.lock, flags);
...@@ -2028,7 +2021,7 @@ static int serial8250_startup(struct uart_port *port) ...@@ -2028,7 +2021,7 @@ static int serial8250_startup(struct uart_port *port)
serial_outp(up, UART_LCR, 0); serial_outp(up, UART_LCR, 0);
} }
if (is_real_interrupt(up->port.irq)) { if (up->port.irq) {
unsigned char iir1; unsigned char iir1;
/* /*
* Test for UARTs that do not reassert THRE when the * Test for UARTs that do not reassert THRE when the
...@@ -2083,7 +2076,7 @@ static int serial8250_startup(struct uart_port *port) ...@@ -2083,7 +2076,7 @@ static int serial8250_startup(struct uart_port *port)
* hardware interrupt, we use a timer-based system. The original * hardware interrupt, we use a timer-based system. The original
* driver used to do this with IRQ0. * driver used to do this with IRQ0.
*/ */
if (!is_real_interrupt(up->port.irq)) { if (!up->port.irq) {
up->timer.data = (unsigned long)up; up->timer.data = (unsigned long)up;
mod_timer(&up->timer, jiffies + uart_poll_timeout(port)); mod_timer(&up->timer, jiffies + uart_poll_timeout(port));
} else { } else {
...@@ -2099,13 +2092,13 @@ static int serial8250_startup(struct uart_port *port) ...@@ -2099,13 +2092,13 @@ static int serial8250_startup(struct uart_port *port)
spin_lock_irqsave(&up->port.lock, flags); spin_lock_irqsave(&up->port.lock, flags);
if (up->port.flags & UPF_FOURPORT) { if (up->port.flags & UPF_FOURPORT) {
if (!is_real_interrupt(up->port.irq)) if (!up->port.irq)
up->port.mctrl |= TIOCM_OUT1; up->port.mctrl |= TIOCM_OUT1;
} else } else
/* /*
* Most PC uarts need OUT2 raised to enable interrupts. * Most PC uarts need OUT2 raised to enable interrupts.
*/ */
if (is_real_interrupt(up->port.irq)) if (up->port.irq)
up->port.mctrl |= TIOCM_OUT2; up->port.mctrl |= TIOCM_OUT2;
serial8250_set_mctrl(&up->port, up->port.mctrl); serial8250_set_mctrl(&up->port, up->port.mctrl);
...@@ -2223,7 +2216,7 @@ static void serial8250_shutdown(struct uart_port *port) ...@@ -2223,7 +2216,7 @@ static void serial8250_shutdown(struct uart_port *port)
del_timer_sync(&up->timer); del_timer_sync(&up->timer);
up->timer.function = serial8250_timeout; up->timer.function = serial8250_timeout;
if (is_real_interrupt(up->port.irq)) if (up->port.irq)
serial_unlink_irq_chain(up); serial_unlink_irq_chain(up);
} }
......
...@@ -70,13 +70,6 @@ ...@@ -70,13 +70,6 @@
#define PASS_LIMIT 256 #define PASS_LIMIT 256
/*
* We default to IRQ0 for the "no irq" hack. Some
* machine types want others as well - they're free
* to redefine this in their header file.
*/
#define is_real_interrupt(irq) ((irq) != 0)
#define BASE_BAUD 115200 #define BASE_BAUD 115200
/* Standard COM flags */ /* Standard COM flags */
...@@ -640,7 +633,7 @@ static int m32r_sio_startup(struct uart_port *port) ...@@ -640,7 +633,7 @@ static int m32r_sio_startup(struct uart_port *port)
* hardware interrupt, we use a timer-based system. The original * hardware interrupt, we use a timer-based system. The original
* driver used to do this with IRQ0. * driver used to do this with IRQ0.
*/ */
if (!is_real_interrupt(up->port.irq)) { if (!up->port.irq) {
unsigned int timeout = up->port.timeout; unsigned int timeout = up->port.timeout;
timeout = timeout > 6 ? (timeout / 2 - 2) : 1; timeout = timeout > 6 ? (timeout / 2 - 2) : 1;
...@@ -687,7 +680,7 @@ static void m32r_sio_shutdown(struct uart_port *port) ...@@ -687,7 +680,7 @@ static void m32r_sio_shutdown(struct uart_port *port)
sio_init(); sio_init();
if (!is_real_interrupt(up->port.irq)) if (!up->port.irq)
del_timer_sync(&up->timer); del_timer_sync(&up->timer);
else else
serial_unlink_irq_chain(up); serial_unlink_irq_chain(up);
......
...@@ -507,7 +507,7 @@ static int __init mpc512x_psc_fifoc_init(void) ...@@ -507,7 +507,7 @@ static int __init mpc512x_psc_fifoc_init(void)
psc_fifoc_irq = irq_of_parse_and_map(np, 0); psc_fifoc_irq = irq_of_parse_and_map(np, 0);
of_node_put(np); of_node_put(np);
if (psc_fifoc_irq == NO_IRQ) { if (psc_fifoc_irq == 0) {
pr_err("%s: Can't get FIFOC irq\n", __func__); pr_err("%s: Can't get FIFOC irq\n", __func__);
iounmap(psc_fifoc); iounmap(psc_fifoc);
return -ENODEV; return -ENODEV;
...@@ -1354,7 +1354,7 @@ static int __devinit mpc52xx_uart_of_probe(struct platform_device *op) ...@@ -1354,7 +1354,7 @@ static int __devinit mpc52xx_uart_of_probe(struct platform_device *op)
} }
psc_ops->get_irq(port, op->dev.of_node); psc_ops->get_irq(port, op->dev.of_node);
if (port->irq == NO_IRQ) { if (port->irq == 0) {
dev_dbg(&op->dev, "Could not get irq\n"); dev_dbg(&op->dev, "Could not get irq\n");
return -EINVAL; return -EINVAL;
} }
......
...@@ -499,7 +499,7 @@ static int __init mux_probe(struct parisc_device *dev) ...@@ -499,7 +499,7 @@ static int __init mux_probe(struct parisc_device *dev)
port->membase = ioremap_nocache(port->mapbase, MUX_LINE_OFFSET); port->membase = ioremap_nocache(port->mapbase, MUX_LINE_OFFSET);
port->iotype = UPIO_MEM; port->iotype = UPIO_MEM;
port->type = PORT_MUX; port->type = PORT_MUX;
port->irq = NO_IRQ; port->irq = 0;
port->uartclk = 0; port->uartclk = 0;
port->fifosize = MUX_FIFO_SIZE; port->fifosize = MUX_FIFO_SIZE;
port->ops = &mux_pops; port->ops = &mux_pops;
......
...@@ -1506,7 +1506,7 @@ static int __init pmz_init_port(struct uart_pmac_port *uap) ...@@ -1506,7 +1506,7 @@ static int __init pmz_init_port(struct uart_pmac_port *uap)
* fixed up interrupt info, but we use the device-tree directly * fixed up interrupt info, but we use the device-tree directly
* here due to early probing so we need the fixup too. * here due to early probing so we need the fixup too.
*/ */
if (uap->port.irq == NO_IRQ && if (uap->port.irq == 0 &&
np->parent && np->parent->parent && np->parent && np->parent->parent &&
of_device_is_compatible(np->parent->parent, "gatwick")) { of_device_is_compatible(np->parent->parent, "gatwick")) {
/* IRQs on gatwick are offset by 64 */ /* IRQs on gatwick are offset by 64 */
......
...@@ -1397,7 +1397,7 @@ static void __devinit sunzilog_init_hw(struct uart_sunzilog_port *up) ...@@ -1397,7 +1397,7 @@ static void __devinit sunzilog_init_hw(struct uart_sunzilog_port *up)
#endif #endif
} }
static int zilog_irq = -1; static int zilog_irq;
static int __devinit zs_probe(struct platform_device *op) static int __devinit zs_probe(struct platform_device *op)
{ {
...@@ -1425,7 +1425,7 @@ static int __devinit zs_probe(struct platform_device *op) ...@@ -1425,7 +1425,7 @@ static int __devinit zs_probe(struct platform_device *op)
rp = sunzilog_chip_regs[inst]; rp = sunzilog_chip_regs[inst];
if (zilog_irq == -1) if (!zilog_irq)
zilog_irq = op->archdata.irqs[0]; zilog_irq = op->archdata.irqs[0];
up = &sunzilog_port_table[inst * 2]; up = &sunzilog_port_table[inst * 2];
...@@ -1580,7 +1580,7 @@ static int __init sunzilog_init(void) ...@@ -1580,7 +1580,7 @@ static int __init sunzilog_init(void)
if (err) if (err)
goto out_unregister_uart; goto out_unregister_uart;
if (zilog_irq != -1) { if (!zilog_irq) {
struct uart_sunzilog_port *up = sunzilog_irq_chain; struct uart_sunzilog_port *up = sunzilog_irq_chain;
err = request_irq(zilog_irq, sunzilog_interrupt, IRQF_SHARED, err = request_irq(zilog_irq, sunzilog_interrupt, IRQF_SHARED,
"zs", sunzilog_irq_chain); "zs", sunzilog_irq_chain);
...@@ -1621,7 +1621,7 @@ static void __exit sunzilog_exit(void) ...@@ -1621,7 +1621,7 @@ static void __exit sunzilog_exit(void)
{ {
platform_driver_unregister(&zs_driver); platform_driver_unregister(&zs_driver);
if (zilog_irq != -1) { if (!zilog_irq) {
struct uart_sunzilog_port *up = sunzilog_irq_chain; struct uart_sunzilog_port *up = sunzilog_irq_chain;
/* Disable Interrupts */ /* Disable Interrupts */
...@@ -1637,7 +1637,7 @@ static void __exit sunzilog_exit(void) ...@@ -1637,7 +1637,7 @@ static void __exit sunzilog_exit(void)
} }
free_irq(zilog_irq, sunzilog_irq_chain); free_irq(zilog_irq, sunzilog_irq_chain);
zilog_irq = -1; zilog_irq = 0;
} }
if (sunzilog_reg.nr) { if (sunzilog_reg.nr) {
......
...@@ -1360,7 +1360,7 @@ static int ucc_uart_probe(struct platform_device *ofdev) ...@@ -1360,7 +1360,7 @@ static int ucc_uart_probe(struct platform_device *ofdev)
} }
qe_port->port.irq = irq_of_parse_and_map(np, 0); qe_port->port.irq = irq_of_parse_and_map(np, 0);
if (qe_port->port.irq == NO_IRQ) { if (qe_port->port.irq == 0) {
dev_err(&ofdev->dev, "could not map IRQ for UCC%u\n", dev_err(&ofdev->dev, "could not map IRQ for UCC%u\n",
qe_port->ucc_num + 1); qe_port->ucc_num + 1);
ret = -EINVAL; ret = -EINVAL;
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
static struct uart_port siu_uart_ports[SIU_PORTS_MAX] = { static struct uart_port siu_uart_ports[SIU_PORTS_MAX] = {
[0 ... SIU_PORTS_MAX-1] = { [0 ... SIU_PORTS_MAX-1] = {
.lock = __SPIN_LOCK_UNLOCKED(siu_uart_ports->lock), .lock = __SPIN_LOCK_UNLOCKED(siu_uart_ports->lock),
.irq = -1, .irq = 0,
}, },
}; };
...@@ -171,7 +171,7 @@ static inline unsigned int siu_check_type(struct uart_port *port) ...@@ -171,7 +171,7 @@ static inline unsigned int siu_check_type(struct uart_port *port)
{ {
if (port->line == 0) if (port->line == 0)
return PORT_VR41XX_SIU; return PORT_VR41XX_SIU;
if (port->line == 1 && port->irq != -1) if (port->line == 1 && port->irq)
return PORT_VR41XX_DSIU; return PORT_VR41XX_DSIU;
return PORT_UNKNOWN; return PORT_UNKNOWN;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册