From patchwork Tue Apr 22 13:26:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 28817 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f70.google.com (mail-qg0-f70.google.com [209.85.192.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 24273203AC for ; Tue, 22 Apr 2014 13:28:17 +0000 (UTC) Received: by mail-qg0-f70.google.com with SMTP id z60sf3596260qgd.5 for ; Tue, 22 Apr 2014 06:28:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:references:in-reply-to:cc:subject:precedence :list-id:list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=7NzX4zN8cg7k94npSizvuD+3diQWJx+4+uVrZscnT30=; b=AR2IlAGbUsYxuuLYfbBNbFS2WFtdIvy+FV6yCFF/8F2IxqFlpQCDuk9KDgJe+MJkZJ BC9sEL8zDhgJjUv4Eaakz6k9rGBqKyBr7JfbBBS1WS8618e94RQ/fugrKqCdFL+YNJ89 qvkZl68Q+j8CxZTWDILoTBpIXRgEPwbqj0qUwvg9+04GyECg+b888va6k5kzLAbp/MdT mzEHUS8t1SoHIJsGuWFP/9f0HRr2sVAhl0Y6R41jUFpyGI05k6zRKHn0On4HWpAndXV6 JjM9dbhD5DF8n5nifP97lrbKXTXNarBfGxOjQpDwq0rYYxfe2C8ASrKti3R2T+mDcPD6 ARYA== X-Gm-Message-State: ALoCoQlXS23WW+utgfqFpzRjI0dLBP/k/ggh3w4KTrNVetJJTMax8P6CpdKi5pIAFkMb3v982eNz X-Received: by 10.236.112.4 with SMTP id x4mr11969238yhg.56.1398173296816; Tue, 22 Apr 2014 06:28:16 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.46.52 with SMTP id j49ls72593qga.67.gmail; Tue, 22 Apr 2014 06:28:16 -0700 (PDT) X-Received: by 10.220.44.20 with SMTP id y20mr69757vce.60.1398173296691; Tue, 22 Apr 2014 06:28:16 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id i7si6903203vei.31.2014.04.22.06.28.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Apr 2014 06:28:16 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id la4so2575504vcb.17 for ; Tue, 22 Apr 2014 06:28:16 -0700 (PDT) X-Received: by 10.52.95.135 with SMTP id dk7mr1369120vdb.32.1398173296588; Tue, 22 Apr 2014 06:28:16 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp24661vcb; Tue, 22 Apr 2014 06:28:16 -0700 (PDT) X-Received: by 10.140.104.103 with SMTP id z94mr11606944qge.91.1398173295880; Tue, 22 Apr 2014 06:28:15 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id v19si17018347qgd.61.2014.04.22.06.28.15 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 22 Apr 2014 06:28:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wcai9-0000za-Ed; Tue, 22 Apr 2014 13:26:09 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wcai7-0000zH-P3 for xen-devel@lists.xenproject.org; Tue, 22 Apr 2014 13:26:08 +0000 Received: from [193.109.254.147:58393] by server-13.bemta-14.messagelabs.com id F5/9B-23211-FED66535; Tue, 22 Apr 2014 13:26:07 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-16.tower-27.messagelabs.com!1398173165!128659!1 X-Originating-IP: [74.125.83.54] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 3154 invoked from network); 22 Apr 2014 13:26:05 -0000 Received: from mail-ee0-f54.google.com (HELO mail-ee0-f54.google.com) (74.125.83.54) by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 22 Apr 2014 13:26:05 -0000 Received: by mail-ee0-f54.google.com with SMTP id d49so4716239eek.27 for ; Tue, 22 Apr 2014 06:26:05 -0700 (PDT) X-Received: by 10.14.241.139 with SMTP id g11mr56228786eer.49.1398173165283; Tue, 22 Apr 2014 06:26:05 -0700 (PDT) Received: from [10.80.2.139] ([185.25.64.249]) by mx.google.com with ESMTPSA id w1sm113059843eel.16.2014.04.22.06.26.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Apr 2014 06:26:04 -0700 (PDT) Message-ID: <53566DEB.8060708@linaro.org> Date: Tue, 22 Apr 2014 14:26:03 +0100 From: Julien Grall User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20131104 Icedove/17.0.10 MIME-Version: 1.0 To: Julien Grall References: <1398171530-27391-1-git-send-email-julien.grall@linaro.org> <1398171530-27391-16-git-send-email-julien.grall@linaro.org> In-Reply-To: <1398171530-27391-16-git-send-email-julien.grall@linaro.org> Cc: xen-devel@lists.xenproject.org, Keir Fraser , tim@xen.org, ian.campbell@citrix.com, stefano.stabellini@citrix.com Subject: Re: [Xen-devel] [PATCH v4 15/18] xen/arm: IRQ: Replace {request, setup}_dt_irq by {request, setup}_irq X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: On 04/22/2014 01:58 PM, Julien Grall wrote: > diff --git a/xen/drivers/char/exynos4210-uart.c b/xen/drivers/char/exynos4210-uart.c > index 370539c..74ee578 100644 > --- a/xen/drivers/char/exynos4210-uart.c > +++ b/xen/drivers/char/exynos4210-uart.c > @@ -30,7 +30,7 @@ > static const struct vuart_info *exynos4210_vuart_info(struct serial_port *port) > @@ -323,12 +323,13 @@ static int __init exynos4210_uart_init(struct dt_device_node *dev, > return res; > } > > - res = dt_device_get_irq(dev, 0, &uart->irq); > - if ( res ) > + res = platform_get_irq(dev, 0); > + if ( uart->irq < 0 ) Argh, I test the wrong variable here. This should be if ( res < 0 ) I've copied the slightly modify patch below. commit 7a98180798deed5e453128bc3556cadef025d894 Author: Julien Grall Date: Thu Mar 27 17:54:27 2014 +0000 xen/arm: IRQ: Replace {request,setup}_dt_irq by {request,setup}_irq Now that irq_desc stores the type of the IRQ (e.g level/edge,...), we don't need to use specific IRQ function for ARM. Also replace every call to dt_device_get_irq by platform_get_irq which is a wrapper to this function and setup the IRQ type correctly. Signed-off-by: Julien Grall Acked-by: Ian Campbell Cc: Keir Fraser --- Changes in v5: - exynos4210 was testing the wrong IRQ variable Changes in v4: - platform_get_irq now returns -1 in case of error. Changes in v3: - Fix typoes in commit message Changes in v2: - Patch added diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index 4a6ed35..cb40b0a 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -47,7 +47,7 @@ static struct { paddr_t hbase; /* Address of virtual interface registers */ paddr_t vbase; /* Address of virtual cpu interface registers */ unsigned int lines; /* Number of interrupts (SPIs + PPIs + SGIs) */ - struct dt_irq maintenance; /* IRQ maintenance */ + unsigned int maintenance_irq; /* IRQ maintenance */ unsigned int cpus; spinlock_t lock; } gic; @@ -431,9 +431,10 @@ void __init gic_init(void) if ( res || !gic.vbase || (gic.vbase & ~PAGE_MASK) ) panic("GIC: Cannot find a valid address for the virtual CPU"); - res = dt_device_get_irq(node, 0, &gic.maintenance); - if ( res ) + res = platform_get_irq(node, 0); + if ( res < 0 ) panic("GIC: Cannot find the maintenance IRQ"); + gic.maintenance_irq = res; /* Set the GIC as the primary interrupt controller */ dt_interrupt_controller = node; @@ -447,7 +448,7 @@ void __init gic_init(void) " gic_vcpu_addr=%"PRIpaddr"\n" " gic_maintenance_irq=%u\n", gic.dbase, gic.cbase, gic.hbase, gic.vbase, - gic.maintenance.irq); + gic.maintenance_irq); if ( (gic.dbase & ~PAGE_MASK) || (gic.cbase & ~PAGE_MASK) || (gic.hbase & ~PAGE_MASK) || (gic.vbase & ~PAGE_MASK) ) @@ -884,8 +885,8 @@ void gic_dump_info(struct vcpu *v) void __cpuinit init_maintenance_interrupt(void) { - request_dt_irq(&gic.maintenance, maintenance_interrupt, - "irq-maintenance", NULL); + request_irq(gic.maintenance_irq, maintenance_interrupt, + "irq-maintenance", NULL); } /* diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c index f1d6398..a09ca25 100644 --- a/xen/arch/arm/irq.c +++ b/xen/arch/arm/irq.c @@ -117,9 +117,9 @@ static inline struct domain *irq_get_domain(struct irq_desc *desc) return desc->action->dev_id; } -int request_dt_irq(const struct dt_irq *irq, - void (*handler)(int, void *, struct cpu_user_regs *), - const char *devname, void *dev_id) +int request_irq(unsigned int irq, + void (*handler)(int, void *, struct cpu_user_regs *), + const char *devname, void *dev_id) { struct irqaction *action; int retval; @@ -130,13 +130,13 @@ int request_dt_irq(const struct dt_irq *irq, * which interrupt is which (messes up the interrupt freeing * logic etc). */ - if (irq->irq >= nr_irqs) + if ( irq >= nr_irqs ) return -EINVAL; - if (!handler) + if ( !handler ) return -EINVAL; action = xmalloc(struct irqaction); - if (!action) + if ( !action ) return -ENOMEM; action->handler = handler; @@ -144,8 +144,8 @@ int request_dt_irq(const struct dt_irq *irq, action->dev_id = dev_id; action->free_on_release = 1; - retval = setup_dt_irq(irq, action); - if (retval) + retval = setup_irq(irq, action); + if ( retval ) xfree(action); return retval; @@ -252,14 +252,14 @@ static int __setup_irq(struct irq_desc *desc, struct irqaction *new) return 0; } -int setup_dt_irq(const struct dt_irq *irq, struct irqaction *new) +int setup_irq(unsigned int irq, struct irqaction *new) { int rc; unsigned long flags; struct irq_desc *desc; bool_t disabled; - desc = irq_to_desc(irq->irq); + desc = irq_to_desc(irq); spin_lock_irqsave(&desc->lock, flags); @@ -269,7 +269,7 @@ int setup_dt_irq(const struct dt_irq *irq, struct irqaction *new) spin_unlock_irqrestore(&desc->lock, flags); printk(XENLOG_ERR "ERROR: IRQ %u is already in use by the domain %u\n", - irq->irq, d->domain_id); + irq, d->domain_id); return -EBUSY; } @@ -289,7 +289,6 @@ int setup_dt_irq(const struct dt_irq *irq, struct irqaction *new) * TODO: Handle case where SPI is setup on different CPU than * the targeted CPU and the priority. */ - desc->arch.type = irq->type; gic_route_irq_to_xen(desc, cpumask_of(smp_processor_id()), GIC_PRI_IRQ); desc->handler->startup(desc); diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c index ce96337..0bff747 100644 --- a/xen/arch/arm/time.c +++ b/xen/arch/arm/time.c @@ -48,13 +48,13 @@ uint64_t __read_mostly boot_count; * register-mapped time source in the SoC. */ unsigned long __read_mostly cpu_khz; /* CPU clock frequency in kHz. */ -static struct dt_irq timer_irq[MAX_TIMER_PPI]; +static unsigned int timer_irq[MAX_TIMER_PPI]; unsigned int timer_get_irq(enum timer_ppi ppi) { ASSERT(ppi >= TIMER_PHYS_SECURE_PPI && ppi < MAX_TIMER_PPI); - return timer_irq[ppi].irq; + return timer_irq[ppi]; } /*static inline*/ s_time_t ticks_to_ns(uint64_t ticks) @@ -120,15 +120,17 @@ int __init init_xen_time(void) /* Retrieve all IRQs for the timer */ for ( i = TIMER_PHYS_SECURE_PPI; i < MAX_TIMER_PPI; i++ ) { - res = dt_device_get_irq(dev, i, &timer_irq[i]); - if ( res ) + res = platform_get_irq(dev, i); + + if ( res < 0 ) panic("Timer: Unable to retrieve IRQ %u from the device tree", i); + timer_irq[i] = res; } printk("Generic Timer IRQ: phys=%u hyp=%u virt=%u\n", - timer_irq[TIMER_PHYS_NONSECURE_PPI].irq, - timer_irq[TIMER_HYP_PPI].irq, - timer_irq[TIMER_VIRT_PPI].irq); + timer_irq[TIMER_PHYS_NONSECURE_PPI], + timer_irq[TIMER_HYP_PPI], + timer_irq[TIMER_VIRT_PPI]); res = platform_init_time(); if ( res ) @@ -192,7 +194,7 @@ int reprogram_timer(s_time_t timeout) /* Handle the firing timer */ static void timer_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs) { - if ( irq == (timer_irq[TIMER_HYP_PPI].irq) && + if ( irq == (timer_irq[TIMER_HYP_PPI]) && READ_SYSREG32(CNTHP_CTL_EL2) & CNTx_CTL_PENDING ) { /* Signal the generic timer code to do its work */ @@ -201,7 +203,7 @@ static void timer_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs) WRITE_SYSREG32(0, CNTHP_CTL_EL2); } - if ( irq == (timer_irq[TIMER_PHYS_NONSECURE_PPI].irq) && + if ( irq == (timer_irq[TIMER_PHYS_NONSECURE_PPI]) && READ_SYSREG32(CNTP_CTL_EL0) & CNTx_CTL_PENDING ) { /* Signal the generic timer code to do its work */ @@ -235,12 +237,12 @@ void __cpuinit init_timer_interrupt(void) WRITE_SYSREG32(0, CNTHP_CTL_EL2); /* Hypervisor's timer disabled */ isb(); - request_dt_irq(&timer_irq[TIMER_HYP_PPI], timer_interrupt, - "hyptimer", NULL); - request_dt_irq(&timer_irq[TIMER_VIRT_PPI], vtimer_interrupt, + request_irq(timer_irq[TIMER_HYP_PPI], timer_interrupt, + "hyptimer", NULL); + request_irq(timer_irq[TIMER_VIRT_PPI], vtimer_interrupt, "virtimer", NULL); - request_dt_irq(&timer_irq[TIMER_PHYS_NONSECURE_PPI], timer_interrupt, - "phytimer", NULL); + request_irq(timer_irq[TIMER_PHYS_NONSECURE_PPI], timer_interrupt, + "phytimer", NULL); } /* Wait a set number of microseconds */ diff --git a/xen/drivers/char/exynos4210-uart.c b/xen/drivers/char/exynos4210-uart.c index 370539c..404ce05 100644 --- a/xen/drivers/char/exynos4210-uart.c +++ b/xen/drivers/char/exynos4210-uart.c @@ -30,7 +30,7 @@ static struct exynos4210_uart { unsigned int baud, clock_hz, data_bits, parity, stop_bits; - struct dt_irq irq; + unsigned int irq; void *regs; struct irqaction irqaction; struct vuart_info vuart; @@ -197,9 +197,9 @@ static void __init exynos4210_uart_init_postirq(struct serial_port *port) uart->irqaction.name = "exynos4210_uart"; uart->irqaction.dev_id = port; - if ( (rc = setup_dt_irq(&uart->irq, &uart->irqaction)) != 0 ) + if ( (rc = setup_irq(uart->irq, &uart->irqaction)) != 0 ) dprintk(XENLOG_ERR, "Failed to allocated exynos4210_uart IRQ %d\n", - uart->irq.irq); + uart->irq); /* Unmask interrupts */ exynos4210_write(uart, UINTM, ~UINTM_ALLI); @@ -272,7 +272,7 @@ static int __init exynos4210_uart_irq(struct serial_port *port) { struct exynos4210_uart *uart = port->uart; - return uart->irq.irq; + return uart->irq; } static const struct vuart_info *exynos4210_vuart_info(struct serial_port *port) @@ -323,12 +323,13 @@ static int __init exynos4210_uart_init(struct dt_device_node *dev, return res; } - res = dt_device_get_irq(dev, 0, &uart->irq); - if ( res ) + res = platform_get_irq(dev, 0); + if ( res < 0 ) { printk("exynos4210: Unable to retrieve the IRQ\n"); - return res; + return -EINVAL; } + uart->irq = res; uart->regs = ioremap_nocache(addr, size); if ( !uart->regs ) diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c index 21f086a..6691806 100644 --- a/xen/drivers/char/ns16550.c +++ b/xen/drivers/char/ns16550.c @@ -76,9 +76,6 @@ static struct ns16550 { u8 bar_idx; bool_t enable_ro; /* Make MMIO devices read only to Dom0 */ #endif -#ifdef HAS_DEVICE_TREE - struct dt_irq dt_irq; -#endif } ns16550_com[2] = { { 0 } }; struct ns16550_config_mmio { @@ -612,13 +609,8 @@ static void __init ns16550_init_postirq(struct serial_port *port) uart->irqaction.handler = ns16550_interrupt; uart->irqaction.name = "ns16550"; uart->irqaction.dev_id = port; -#ifdef HAS_DEVICE_TREE - if ( (rc = setup_dt_irq(&uart->dt_irq, &uart->irqaction)) != 0 ) - printk("ERROR: Failed to allocate ns16550 DT IRQ.\n"); -#else if ( (rc = setup_irq(uart->irq, &uart->irqaction)) != 0 ) printk("ERROR: Failed to allocate ns16550 IRQ %d\n", uart->irq); -#endif } ns16550_setup_postirq(uart); @@ -1172,12 +1164,10 @@ static int __init ns16550_uart_dt_init(struct dt_device_node *dev, if ( uart->reg_width != 1 && uart->reg_width != 4 ) return -EINVAL; - res = dt_device_get_irq(dev, 0, &uart->dt_irq); - if ( res ) - return res; - - /* The common bit of the driver mostly deals with irq not dt_irq. */ - uart->irq = uart->dt_irq.irq; + res = platform_get_irq(dev, 0); + if ( ! res ) + return -EINVAL; + uart->irq = res; uart->dw_usr_bsy = dt_device_is_compatible(dev, "snps,dw-apb-uart"); diff --git a/xen/drivers/char/omap-uart.c b/xen/drivers/char/omap-uart.c index b8da509..e598785 100644 --- a/xen/drivers/char/omap-uart.c +++ b/xen/drivers/char/omap-uart.c @@ -30,7 +30,7 @@ static struct omap_uart { u32 baud, clock_hz, data_bits, parity, stop_bits, fifo_size; - struct dt_irq irq; + unsigned int irq; char __iomem *regs; struct irqaction irqaction; struct vuart_info vuart; @@ -205,10 +205,10 @@ static void __init omap_uart_init_postirq(struct serial_port *port) uart->irqaction.name = "omap_uart"; uart->irqaction.dev_id = port; - if ( setup_dt_irq(&uart->irq, &uart->irqaction) != 0 ) + if ( setup_irq(uart->irq, &uart->irqaction) != 0 ) { dprintk(XENLOG_ERR, "Failed to allocated omap_uart IRQ %d\n", - uart->irq.irq); + uart->irq); return; } @@ -259,7 +259,7 @@ static int __init omap_uart_irq(struct serial_port *port) { struct omap_uart *uart = port->uart; - return ((uart->irq.irq > 0) ? uart->irq.irq : -1); + return ((uart->irq > 0) ? uart->irq : -1); } static const struct vuart_info *omap_vuart_info(struct serial_port *port) @@ -317,12 +317,13 @@ static int __init omap_uart_init(struct dt_device_node *dev, return res; } - res = dt_device_get_irq(dev, 0, &uart->irq); - if ( res ) + res = platform_get_irq(dev, 0); + if ( res < 0 ) { printk("omap-uart: Unable to retrieve the IRQ\n"); - return res; + return -EINVAL; } + uart->irq = res; uart->regs = ioremap_nocache(addr, size); if ( !uart->regs ) diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c index 459e686..89bda94 100644 --- a/xen/drivers/char/pl011.c +++ b/xen/drivers/char/pl011.c @@ -32,7 +32,7 @@ static struct pl011 { unsigned int baud, clock_hz, data_bits, parity, stop_bits; - struct dt_irq irq; + unsigned int irq; void __iomem *regs; /* UART with IRQ line: interrupt-driven I/O. */ struct irqaction irqaction; @@ -132,13 +132,13 @@ static void __init pl011_init_postirq(struct serial_port *port) struct pl011 *uart = port->uart; int rc; - if ( uart->irq.irq > 0 ) + if ( uart->irq > 0 ) { uart->irqaction.handler = pl011_interrupt; uart->irqaction.name = "pl011"; uart->irqaction.dev_id = port; - if ( (rc = setup_dt_irq(&uart->irq, &uart->irqaction)) != 0 ) - printk("ERROR: Failed to allocate pl011 IRQ %d\n", uart->irq.irq); + if ( (rc = setup_irq(uart->irq, &uart->irqaction)) != 0 ) + printk("ERROR: Failed to allocate pl011 IRQ %d\n", uart->irq); } /* Clear pending error interrupts */ @@ -186,7 +186,8 @@ static int pl011_getc(struct serial_port *port, char *pc) static int __init pl011_irq(struct serial_port *port) { struct pl011 *uart = port->uart; - return ((uart->irq.irq > 0) ? uart->irq.irq : -1); + + return ((uart->irq > 0) ? uart->irq : -1); } static const struct vuart_info *pl011_vuart(struct serial_port *port) @@ -239,12 +240,13 @@ static int __init pl011_uart_init(struct dt_device_node *dev, return res; } - res = dt_device_get_irq(dev, 0, &uart->irq); - if ( res ) + res = platform_get_irq(dev, 0); + if ( res < 0 ) { printk("pl011: Unable to retrieve the IRQ\n"); - return res; + return -EINVAL; } + uart->irq = res; uart->regs = ioremap_nocache(addr, size); if ( !uart->regs ) diff --git a/xen/include/asm-arm/irq.h b/xen/include/asm-arm/irq.h index 93d2128..f9b9a9f 100644 --- a/xen/include/asm-arm/irq.h +++ b/xen/include/asm-arm/irq.h @@ -40,11 +40,6 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq); void init_IRQ(void); void init_secondary_IRQ(void); -int request_dt_irq(const struct dt_irq *irq, - void (*handler)(int, void *, struct cpu_user_regs *), - const char *devname, void *dev_id); -int setup_dt_irq(const struct dt_irq *irq, struct irqaction *new); - int route_dt_irq_to_guest(struct domain *d, const struct dt_irq *irq, const char *devname); int platform_get_irq(const struct dt_device_node *device,