From patchwork Fri Oct 24 09:58:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 39414 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 64DD320341 for ; Fri, 24 Oct 2014 10:00:21 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id ge10sf1644032lab.5 for ; Fri, 24 Oct 2014 03:00:20 -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:from:to:date:message-id:in-reply-to :references:mime-version: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=RkC3e9xJb+Hgv9TtmSDxbrzv+tg5FuQy8xkuXQAFkxc=; b=MAeXVsB8eL7DZmnYb8FIYIkdKo3uVs4P3LqyWqVdprTTmn9G5qEBwhlkOtERZz+wkD /rGxXyGzLMQr5arO6FdemFg4jQJQ6Ti+HwYXxi8fi6JnL0zIA8dQiL1F6VlfC74E7CXE d4nBP6jkrts1c0/4nfdq36wMYEZ808+1jLjYdARzckEIWKuKmwRAJ3KPkem1ClJ5k9uJ 31hEtiNHHuJnxWpvWuuVRvkl6cuQ+ZJhQXoE0C4Ybe3lIPjqL1qGqeOlqRo7SM6aQp21 T4KnQpfpzW4a0hnV8eKuDG3bHCVG778w5R7/K3oB36oZ3YUZ/KuKMAKVwGZods0RMqMS Wkog== X-Gm-Message-State: ALoCoQmLrQ0E5yXe+JEV0xStmwJerZEuFIs4R4XAM1aZISQXqHzFbuaPqHAEQhlnovE2VzvRZjEl X-Received: by 10.112.137.202 with SMTP id qk10mr425028lbb.11.1414144820126; Fri, 24 Oct 2014 03:00:20 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.3.170 with SMTP id d10ls394226lad.75.gmail; Fri, 24 Oct 2014 03:00:19 -0700 (PDT) X-Received: by 10.112.77.74 with SMTP id q10mr3287514lbw.66.1414144819949; Fri, 24 Oct 2014 03:00:19 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id ap3si6226053lbc.33.2014.10.24.03.00.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 24 Oct 2014 03:00:19 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id gf13so958662lab.22 for ; Fri, 24 Oct 2014 03:00:19 -0700 (PDT) X-Received: by 10.112.189.10 with SMTP id ge10mr3235295lbc.23.1414144819464; Fri, 24 Oct 2014 03:00:19 -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.112.84.229 with SMTP id c5csp398402lbz; Fri, 24 Oct 2014 03:00:18 -0700 (PDT) X-Received: by 10.224.41.142 with SMTP id o14mr4290080qae.100.1414144818079; Fri, 24 Oct 2014 03:00:18 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id c89si6919443qgc.108.2014.10.24.03.00.17 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 24 Oct 2014 03:00:18 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) 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 1Xhbdu-0001eO-Vn; Fri, 24 Oct 2014 09:58:46 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xhbdt-0001cn-Di for xen-devel@lists.xen.org; Fri, 24 Oct 2014 09:58:45 +0000 Received: from [193.109.254.147:57038] by server-8.bemta-14.messagelabs.com id D2/C3-01875-4D22A445; Fri, 24 Oct 2014 09:58:44 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-3.tower-27.messagelabs.com!1414144721!12182712!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n X-StarScan-Received: X-StarScan-Version: 6.12.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 26236 invoked from network); 24 Oct 2014 09:58:42 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 24 Oct 2014 09:58:42 -0000 X-IronPort-AV: E=Sophos;i="5.04,779,1406592000"; d="scan'208";a="185837471" Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.3.181.6; Fri, 24 Oct 2014 05:58:41 -0400 Received: from drall.uk.xensource.com ([10.80.16.71]) by ukmail1.uk.xensource.com with smtp (Exim 4.69) (envelope-from ) id 1Xhbdo-0003vO-RU; Fri, 24 Oct 2014 10:58:41 +0100 Received: by drall.uk.xensource.com (sSMTP sendmail emulation); Fri, 24 Oct 2014 10:58:40 +0100 From: Ian Campbell To: Date: Fri, 24 Oct 2014 10:58:36 +0100 Message-ID: <1414144717-32328-4-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1414144694.15687.31.camel@citrix.com> References: <1414144694.15687.31.camel@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Ian Campbell , stefano.stabellini@eu.citrix.com, julien.grall@linaro.org, tim@xen.org, Clark Laughlin , Pranavkumar Sawargaonkar Subject: [Xen-devel] [PATCH 4/5] xen: refactor irq_set_type out of platform_get_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: ian.campbell@citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) 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: When parsing a PCI nodes interrupt-map property I need to be able to configure an interrupt which has no associated dt_device_node. So refactor the code and expose. Signed-off-by: Ian Campbell --- xen/arch/arm/irq.c | 16 ++++++++++------ xen/include/asm-arm/irq.h | 1 + 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c index 25ecf1d..084324a 100644 --- a/xen/arch/arm/irq.c +++ b/xen/arch/arm/irq.c @@ -520,6 +520,15 @@ unlock: return ret; } +int irq_set_type(unsigned int irq, unsigned int type) +{ + /* Setup the IRQ type */ + if ( irq < NR_LOCAL_IRQS ) + return irq_local_set_type(irq, type); + else + return irq_set_spi_type(irq, type); +} + int platform_get_irq(const struct dt_device_node *device, int index) { struct dt_irq dt_irq; @@ -533,12 +542,7 @@ int platform_get_irq(const struct dt_device_node *device, int index) irq = dt_irq.irq; type = dt_irq.type; - /* Setup the IRQ type */ - if ( irq < NR_LOCAL_IRQS ) - res = irq_local_set_type(irq, type); - else - res = irq_set_spi_type(irq, type); - + res = irq_set_type(irq, type); if ( res ) return -1; diff --git a/xen/include/asm-arm/irq.h b/xen/include/asm-arm/irq.h index e877334..778e79a 100644 --- a/xen/include/asm-arm/irq.h +++ b/xen/include/asm-arm/irq.h @@ -47,6 +47,7 @@ void arch_move_irqs(struct vcpu *v); /* Set IRQ type for an SPI */ int irq_set_spi_type(unsigned int spi, unsigned int type); +int irq_set_type(unsigned int irq, unsigned int type); int platform_get_irq(const struct dt_device_node *device, int index); void irq_set_affinity(struct irq_desc *desc, const cpumask_t *cpu_mask);