From patchwork Tue Oct 6 17:03:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 7338101 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9816BBEEA4 for ; Tue, 6 Oct 2015 17:07:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C6CC02076E for ; Tue, 6 Oct 2015 17:07:48 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DE55C2051D for ; Tue, 6 Oct 2015 17:07:47 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZjVg3-00013B-LC; Tue, 06 Oct 2015 17:05:23 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZjVfS-0007G4-9m for linux-arm-kernel@lists.infradead.org; Tue, 06 Oct 2015 17:04:48 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E8E3E399; Tue, 6 Oct 2015 10:04:28 -0700 (PDT) Received: from approximate.cambridge.arm.com (approximate.cambridge.arm.com [10.1.209.125]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0C81A3F487; Tue, 6 Oct 2015 10:04:26 -0700 (PDT) From: Marc Zyngier To: Rob Herring , Jason Cooper , Thomas Gleixner , Bjorn Helgaas Subject: [PATCH v2 2/8] of/irq: Use of_msi_get_domain instead of open-coded "msi-parent" parsing Date: Tue, 6 Oct 2015 18:03:57 +0100 Message-Id: <1444151043-31084-3-git-send-email-marc.zyngier@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1444151043-31084-1-git-send-email-marc.zyngier@arm.com> References: <1444151043-31084-1-git-send-email-marc.zyngier@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151006_100446_539966_08C50BA3 X-CRM114-Status: GOOD ( 11.15 ) X-Spam-Score: -6.9 (------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, David Daney , Robin Murphy , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Now that we have a function that implements the complexity of the "msi-parent" property parsing, switch to that. Signed-off-by: Marc Zyngier --- drivers/of/irq.c | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/drivers/of/irq.c b/drivers/of/irq.c index 62cfdc2..89ebc61 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c @@ -580,26 +580,6 @@ err: } /** - * of_msi_configure - Set the msi_domain field of a device - * @dev: device structure to associate with an MSI irq domain - * @np: device node for that device - */ -void of_msi_configure(struct device *dev, struct device_node *np) -{ - struct device_node *msi_np; - struct irq_domain *d; - - msi_np = of_parse_phandle(np, "msi-parent", 0); - if (!msi_np) - return; - - d = irq_find_matching_host(msi_np, DOMAIN_BUS_PLATFORM_MSI); - if (!d) - d = irq_find_host(msi_np); - dev_set_msi_domain(dev, d); -} - -/** * of_msi_map_rid - Map a MSI requester ID for a device. * @dev: device for which the mapping is to be done. * @msi_np: device node of the expected msi controller. @@ -741,3 +721,14 @@ struct irq_domain *of_msi_get_domain(struct device *dev, return NULL; } + +/** + * of_msi_configure - Set the msi_domain field of a device + * @dev: device structure to associate with an MSI irq domain + * @np: device node for that device + */ +void of_msi_configure(struct device *dev, struct device_node *np) +{ + dev_set_msi_domain(dev, + of_msi_get_domain(dev, np, DOMAIN_BUS_PLATFORM_MSI)); +}