Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1240745

[PATCH v2 2/8] of/irq: Use of_msi_get_domain instead of open-coded "msi-parent" parsing

From Marc Zyngier <marc.zyngier@arm.com>
Newsgroups linux.kernel
Subject [PATCH v2 2/8] of/irq: Use of_msi_get_domain instead of open-coded "msi-parent" parsing
Date 2015-10-06 19:10 +0200
Message-ID <qgDUv-3Yw-39@gated-at.bofh.it> (permalink)
References <qgDUu-3Yw-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Now that we have a function that implements the complexity of the
"msi-parent" property parsing, switch to that.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 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));
+}
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/8] of: Handle multi-parent version of msi-parent & msi-map Marc Zyngier <marc.zyngier@arm.com> - 2015-10-06 19:10 +0200
  [PATCH v2 5/8] of/irq: Split of_msi_map_rid to reuse msi-map lookup Marc Zyngier <marc.zyngier@arm.com> - 2015-10-06 19:10 +0200
  [PATCH v2 2/8] of/irq: Use of_msi_get_domain instead of open-coded "msi-parent" parsing Marc Zyngier <marc.zyngier@arm.com> - 2015-10-06 19:10 +0200
  [PATCH v2 1/8] of/irq: Add support code for multi-parent version of "msi-parent" Marc Zyngier <marc.zyngier@arm.com> - 2015-10-06 19:10 +0200
  [PATCH v2 6/8] of/irq: Use the msi-map property to provide device-specific MSI domain Marc Zyngier <marc.zyngier@arm.com> - 2015-10-06 19:10 +0200
  [PATCH v2 8/8] PCI/MSI: Allow the MSI domain to be device-specific Marc Zyngier <marc.zyngier@arm.com> - 2015-10-06 19:10 +0200
    Re: [PATCH v2 8/8] PCI/MSI: Allow the MSI domain to be  device-specific Bjorn Helgaas <helgaas@kernel.org> - 2015-10-15 22:20 +0200
  Re: [PATCH v2 0/8] of: Handle multi-parent version of msi-parent & msi-map Rob Herring <robh+dt@kernel.org> - 2015-10-15 22:50 +0200

csiph-web