int __init request_dt_irq(const struct dt_irq *irq, void (*handler)(int, void *, struct cpu_user_regs *), unsigned long irqflags, const char *devname, void *dev_id) { struct irqaction *action; int retval; /* * Sanity-check: shared interrupts must pass in a real dev-ID, * otherwise we'll have trouble later trying to figure out * which interrupt is which (messes up the interrupt freeing * logic etc). */ if (irq->irq >= nr_irqs) return -EINVAL; if (!handler) return -EINVAL; action = xmalloc(struct irqaction); if (!action) return -ENOMEM; action->handler = handler; action->name = devname; action->dev_id = dev_id; action->free_on_release = 1; retval = setup_dt_irq(irq, action); if (retval) xfree(action); return retval; }
static void __init omap_uart_init_postirq(struct serial_port *port) { struct omap_uart *uart = port->uart; uart->irqaction.handler = omap_uart_interrupt; uart->irqaction.name = "omap_uart"; uart->irqaction.dev_id = port; if ( setup_dt_irq(&uart->irq, &uart->irqaction) != 0 ) { dprintk(XENLOG_ERR, "Failed to allocated omap_uart IRQ %d\n", uart->irq.irq); return; } /* Enable interrupts */ omap_write(uart, UART_IER, UART_IER_ERDAI|UART_IER_ETHREI|UART_IER_ELSI); }
static void __init exynos4210_uart_init_postirq(struct serial_port *port) { struct exynos4210_uart *uart = port->uart; int rc; uart->irqaction.handler = exynos4210_uart_interrupt; uart->irqaction.name = "exynos4210_uart"; uart->irqaction.dev_id = port; if ( (rc = setup_dt_irq(&uart->irq, &uart->irqaction)) != 0 ) dprintk(XENLOG_ERR, "Failed to allocated exynos4210_uart IRQ %d\n", uart->irq.irq); /* Unmask interrupts */ exynos4210_write(uart, UINTM, ~UINTM_ALLI); /* Clear pending interrupts */ exynos4210_write(uart, UINTP, UINTM_ALLI); /* Enable interrupts */ exynos4210_write(uart, UMCON, exynos4210_read(uart, UMCON) | UMCON_INT_EN); }