diff mbox

[1/2] kernel: irq: rename irq_find_host() to irq_domain_lookup()

Message ID 1423785388-31164-2-git-send-email-linus.walleij@linaro.org
State New
Headers show

Commit Message

Linus Walleij Feb. 12, 2015, 11:56 p.m. UTC
This function name has very strange name convention making me and
others confused, it could be understood as finding the host given
an irq number but that's not it. Rename it irq_domain_lookup()
to match what the function actually does and change all in-kernel
users over to this name.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/powerpc/platforms/cell/axon_msi.c |  2 +-
 drivers/irqchip/irq-mtk-sysirq.c       |  2 +-
 drivers/of/irq.c                       |  2 +-
 include/linux/irqdomain.h              | 18 +++++++++---------
 kernel/irq/irqdomain.c                 |  8 ++++----
 5 files changed, 16 insertions(+), 16 deletions(-)
diff mbox

Patch

diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/cell/axon_msi.c
index 623bd961465a..8861ee0353c2 100644
--- a/arch/powerpc/platforms/cell/axon_msi.c
+++ b/arch/powerpc/platforms/cell/axon_msi.c
@@ -184,7 +184,7 @@  static struct axon_msic *find_msi_translator(struct pci_dev *dev)
 		goto out_error;
 	}
 
-	irq_domain = irq_find_host(dn);
+	irq_domain = irq_domain_lookup(dn);
 	if (!irq_domain) {
 		dev_dbg(&dev->dev, "axon_msi: no irq_domain found for node %s\n",
 			dn->full_name);
diff --git a/drivers/irqchip/irq-mtk-sysirq.c b/drivers/irqchip/irq-mtk-sysirq.c
index 0b0d2c00a2df..a004a9f64e93 100644
--- a/drivers/irqchip/irq-mtk-sysirq.c
+++ b/drivers/irqchip/irq-mtk-sysirq.c
@@ -126,7 +126,7 @@  static int __init mtk_sysirq_of_init(struct device_node *node,
 	struct mtk_sysirq_chip_data *chip_data;
 	int ret = 0;
 
-	domain_parent = irq_find_host(parent);
+	domain_parent = irq_domain_lookup(parent);
 	if (!domain_parent) {
 		pr_err("mtk_sysirq: interrupt-parent not found\n");
 		return -EINVAL;
diff --git a/drivers/of/irq.c b/drivers/of/irq.c
index 0d7765807f49..8154031a256c 100644
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -399,7 +399,7 @@  int of_irq_get(struct device_node *dev, int index)
 	if (rc)
 		return rc;
 
-	domain = irq_find_host(oirq.np);
+	domain = irq_domain_lookup(oirq.np);
 	if (!domain)
 		return -EPROBE_DEFER;
 
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index 676d7306a360..508833c99418 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -19,14 +19,14 @@ 
  *
  * The host code and data structures are agnostic to whether or not
  * we use an open firmware device-tree. We do have references to struct
- * device_node in two places: in irq_find_host() to find the host matching
- * a given interrupt controller node, and of course as an argument to its
- * counterpart domain->ops->match() callback. However, those are treated as
- * generic pointers by the core and the fact that it's actually a device-node
- * pointer is purely a convention between callers and implementation. This
- * code could thus be used on other architectures by replacing those two
- * by some sort of arch-specific void * "token" used to identify interrupt
- * controllers.
+ * device_node in two places: in irq_domain_lookup() to find the
+ * domain matching a given interrupt controller device tree node, and of
+ * course as an argument to its counterpart domain->ops->match() callback.
+ * However, those are treated as generic pointers by the core and the fact
+ * that it's actually a device-node pointer is purely a convention between
+ * callers and implementation. This code could thus be used on other
+ * architectures by replacing those two by some sort of arch-specific void *
+ * "token" used to identify interrupt controllers.
  */
 
 #ifndef _LINUX_IRQDOMAIN_H
@@ -161,7 +161,7 @@  struct irq_domain *irq_domain_add_legacy(struct device_node *of_node,
 					 irq_hw_number_t first_hwirq,
 					 const struct irq_domain_ops *ops,
 					 void *host_data);
-extern struct irq_domain *irq_find_host(struct device_node *node);
+extern struct irq_domain *irq_domain_lookup(struct device_node *node);
 extern void irq_set_default_host(struct irq_domain *host);
 
 /**
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 7fac311057b8..b6f21eb6fe2d 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -187,10 +187,10 @@  struct irq_domain *irq_domain_add_legacy(struct device_node *of_node,
 EXPORT_SYMBOL_GPL(irq_domain_add_legacy);
 
 /**
- * irq_find_host() - Locates a domain for a given device node
+ * irq_domain_lookup() - Locates a domain for a given device node
  * @node: device-tree node of the interrupt controller
  */
-struct irq_domain *irq_find_host(struct device_node *node)
+struct irq_domain *irq_domain_lookup(struct device_node *node)
 {
 	struct irq_domain *h, *found = NULL;
 	int rc;
@@ -215,7 +215,7 @@  struct irq_domain *irq_find_host(struct device_node *node)
 	mutex_unlock(&irq_domain_mutex);
 	return found;
 }
-EXPORT_SYMBOL_GPL(irq_find_host);
+EXPORT_SYMBOL_GPL(irq_domain_lookup);
 
 /**
  * irq_set_default_host() - Set a "default" irq domain
@@ -471,7 +471,7 @@  unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data)
 	unsigned int type = IRQ_TYPE_NONE;
 	int virq;
 
-	domain = irq_data->np ? irq_find_host(irq_data->np) : irq_default_domain;
+	domain = irq_data->np ? irq_domain_lookup(irq_data->np) : irq_default_domain;
 	if (!domain) {
 		pr_warn("no irq domain found for %s !\n",
 			of_node_full_name(irq_data->np));