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: 526839 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 4F40F140D88 for ; Wed, 7 Oct 2015 04:06:46 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752689AbbJFRGb (ORCPT ); Tue, 6 Oct 2015 13:06:31 -0400 Received: from foss.arm.com ([217.140.101.70]:53514 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753367AbbJFRE3 (ORCPT ); Tue, 6 Oct 2015 13:04:29 -0400 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 Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, Mark Rutland , David Daney , Robin Murphy 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> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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)); +}