From patchwork Thu Feb 12 23:56:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 44635 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f200.google.com (mail-we0-f200.google.com [74.125.82.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8329021527 for ; Thu, 12 Feb 2015 23:57:07 +0000 (UTC) Received: by mail-we0-f200.google.com with SMTP id k11sf8554652wes.3 for ; Thu, 12 Feb 2015 15:57:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=cmbT0LqGdOELbTmfXTRxx8kN5PYhV0uJ+u4JaumMbG8=; b=OL71o3RpjH6i9sULjSQQLeBzVa6cMOsm9cYfVdA6YA89z2Ue2qRu0tEeHiZ/q7NMUX 6tQlICdww3sIgpqOwP0Syq6SShfIj88NoFArX0zEY0EZo4WGqjNjq7Gt4hKRUT/EFxCf KxxmN2gdQuKveVtA2o+zrEJHiwKXE7MuuRShnYa/vAhoipf6MteWwvaD44lbxsilHw8a N5+oDa9dbeDPltdPDQPc8/hWDNt/KvIEyszzgH3sr2b97PxW25yl9CiC9nexoQXSBAlw X+FBj8aXRYirYLu6E/c1Njr4AyeztMEjNjtrUKcJNvOhEvcAyi2p6BE4p0cuJfJwR2j0 D1RA== X-Gm-Message-State: ALoCoQnnaNNOSpXkPm/wGvLZlTQOltLhQ4PxkGlLuN4kYA5PRvwLxD2NBKerRu+Z1vKOit66/vMe X-Received: by 10.180.39.164 with SMTP id q4mr863031wik.5.1423785426840; Thu, 12 Feb 2015 15:57:06 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.116.115 with SMTP id jv19ls239421lab.64.gmail; Thu, 12 Feb 2015 15:57:06 -0800 (PST) X-Received: by 10.152.25.165 with SMTP id d5mr5446055lag.43.1423785426655; Thu, 12 Feb 2015 15:57:06 -0800 (PST) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id e8si364298lam.60.2015.02.12.15.57.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Feb 2015 15:57:06 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by labgq15 with SMTP id gq15so13311542lab.3 for ; Thu, 12 Feb 2015 15:57:06 -0800 (PST) X-Received: by 10.152.179.172 with SMTP id dh12mr2970519lac.76.1423785426558; Thu, 12 Feb 2015 15:57:06 -0800 (PST) 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.35.133 with SMTP id h5csp738728lbj; Thu, 12 Feb 2015 15:57:05 -0800 (PST) X-Received: by 10.70.45.39 with SMTP id j7mr10194023pdm.169.1423785424710; Thu, 12 Feb 2015 15:57:04 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cw7si638021pad.48.2015.02.12.15.57.02; Thu, 12 Feb 2015 15:57:04 -0800 (PST) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752105AbbBLX4u (ORCPT + 28 others); Thu, 12 Feb 2015 18:56:50 -0500 Received: from mail-pa0-f42.google.com ([209.85.220.42]:48762 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751628AbbBLX4s (ORCPT ); Thu, 12 Feb 2015 18:56:48 -0500 Received: by mail-pa0-f42.google.com with SMTP id rd3so14804449pab.1 for ; Thu, 12 Feb 2015 15:56:47 -0800 (PST) X-Received: by 10.70.136.66 with SMTP id py2mr263506pdb.100.1423785407750; Thu, 12 Feb 2015 15:56:47 -0800 (PST) Received: from localhost.localdomain.com ([210.177.145.245]) by mx.google.com with ESMTPSA id qv9sm4870213pab.27.2015.02.12.15.56.45 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Feb 2015 15:56:47 -0800 (PST) From: Linus Walleij To: linux-kernel@vger.kernel.org, Grant Likely , Benjamin Herrenschmidt , Thomas Gleixner Cc: Linus Walleij Subject: [PATCH 1/2] kernel: irq: rename irq_find_host() to irq_domain_lookup() Date: Fri, 13 Feb 2015 07:56:27 +0800 Message-Id: <1423785388-31164-2-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1423785388-31164-1-git-send-email-linus.walleij@linaro.org> References: <1423785388-31164-1-git-send-email-linus.walleij@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org 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.41 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-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- 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 --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));