Message ID | 1445453249-32557-4-git-send-email-Suravee.Suthikulpanit@amd.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org> X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D55F19F37F for <patchwork-linux-arm@patchwork.kernel.org>; Wed, 21 Oct 2015 18:50:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 083E2208B3 for <patchwork-linux-arm@patchwork.kernel.org>; Wed, 21 Oct 2015 18:50:28 +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 E86D1208A0 for <patchwork-linux-arm@patchwork.kernel.org>; Wed, 21 Oct 2015 18:50:26 +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 1ZoyRR-0003zL-Rk; Wed, 21 Oct 2015 18:48:53 +0000 Received: from mail-bl2on0063.outbound.protection.outlook.com ([65.55.169.63] helo=na01-bl2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZoyQo-0003iz-LN for linux-arm-kernel@lists.infradead.org; Wed, 21 Oct 2015 18:48:15 +0000 Received: from CY1PR12CA0059.namprd12.prod.outlook.com (10.163.230.27) by SN1PR12MB0720.namprd12.prod.outlook.com (10.163.209.22) with Microsoft SMTP Server (TLS) id 15.1.300.14; Wed, 21 Oct 2015 18:47:51 +0000 Received: from BY2NAM03FT011.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::200) by CY1PR12CA0059.outlook.office365.com (2a01:111:e400:c42b::27) with Microsoft SMTP Server (TLS) id 15.1.306.13 via Frontend Transport; Wed, 21 Oct 2015 18:47:50 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.221) smtp.mailfrom=amd.com; apm.com; dkim=none (message not signed) header.d=none; apm.com; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from atltwp01.amd.com (165.204.84.221) by BY2NAM03FT011.mail.protection.outlook.com (10.152.84.233) with Microsoft SMTP Server id 15.1.306.8 via Frontend Transport; Wed, 21 Oct 2015 18:47:49 +0000 X-WSS-ID: 0NWL2VO-07-KH0-02 X-M-MSG: Received: from satlvexedge02.amd.com (satlvexedge02.amd.com [10.177.96.29]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by atltwp01.amd.com (Axway MailGate 5.3.1) with ESMTPS id 2D588CAE635; Wed, 21 Oct 2015 14:47:47 -0400 (EDT) Received: from SATLEXDAG01.amd.com (10.181.40.3) by SATLVEXEDGE02.amd.com (10.177.96.29) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 21 Oct 2015 13:47:56 -0500 Received: from ssuthiku-fedora-lt.amd.com (10.180.168.240) by SATLEXDAG01.amd.com (10.181.40.3) with Microsoft SMTP Server id 14.3.266.1; Wed, 21 Oct 2015 14:47:46 -0400 From: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> To: <marc.zyngier@arm.com>, <tglx@linutronix.de>, <jason@lakedaemon.net>, <rjw@rjwysocki.net> Subject: [PATCH V3 3/6] irqdomain: introduce is_fwnode_irqchip helper Date: Wed, 21 Oct 2015 11:47:26 -0700 Message-ID: <1445453249-32557-4-git-send-email-Suravee.Suthikulpanit@amd.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1445453249-32557-1-git-send-email-Suravee.Suthikulpanit@amd.com> References: <1445453249-32557-1-git-send-email-Suravee.Suthikulpanit@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.221; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(428002)(189002)(199003)(48376002)(2950100001)(92566002)(50226001)(101416001)(229853001)(47776003)(105586002)(106466001)(50986999)(575784001)(77096005)(46102003)(36756003)(5008740100001)(5001770100001)(5001920100001)(97736004)(86362001)(76176999)(189998001)(53416004)(5003940100001)(19580405001)(50466002)(64706001)(5003600100002)(5007970100001)(87936001)(19580395003)(2201001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0720; H:atltwp01.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0720; 2:TcufPYV6EVftHwBn8GxevE2uLovA3P7gmobSQvJakFLvSsHyMN+C7Iru4TRS2gsahna+0PwIoF7CUYRE+nfWM7munmTzJITLiUGQRYDpuvQ3/WaQDfcZRywkuaCBX8TNobmzltlaazNXebxC26hYZjzoOwAtVlJpfzejpyzu4OY=; 3:WDDb/POLSuO64MfjfA5vt+EpEgyL9YiDKamI0TbWVysg+qVztYqQlUgGELntejOdnOGtZZNtVOsThnny3C0VdF0SF38AVyu9CU4UR3xBtALji1z3fofuI1oAWdFGdy3QUfhT53/4nVelunazG4P77cp6VaQ3fWJUnO8W+Kz46fjcY1IaA6cj9HdChUEDU1eyaIOcGjrz6HKAiIFptXyQ+gtX+pGkL6ebPVX1zM//YC/FiCqiuBeVSkE4u9A9yC3/; 25:CiFkiFapgA3AGt8QlSXGnN62M/ezPvz9KxZ4q0V14ay8ZPEuPGxlviOEpzxeegfR1g36wP6qszdO+qaBJ3h9legD1JynLZ3xREJDKJS7BLkByjSqZInloVMaBym9R7ZkuiWyQAhhYf58mNwIGdhf/kfixY7O/ns5FTlLSNiqjd7Fzd30wv4ym27xLQ19CNUnXdBIvd5l9MWZhJiS/6JSuNY2XiRweva4gxYm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B0720C8D5C9A50494B9BAF638F3380@SN1PR12MB0720.namprd12.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(520078)(5005006)(3002001)(102115026); SRVR:SN1PR12MB0720; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0720; X-Forefront-PRVS: 073631BD3D X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR12MB0720; 23:9QiaoYRS2kCwCaNPI0EwMB0WYE4UyrQsOw7xsq4GR?= =?us-ascii?Q?9ea9ofVNTPEjzujfNKV7kdlOxQW5RKPwUAbN5PX6ujkZhhdEX5hGzl8l6bWy?= =?us-ascii?Q?89skt8Grz/mw2ddsF3Tx773Ywn2ZrCxjkoUl5hvB0SEr6XrIGXmBBaj8yge2?= =?us-ascii?Q?9K2wOBnIqYyzxmzyZw9aObDQWFMSbt5jkJsxDPMHxvD4YiPvxPFi10eHa9xY?= =?us-ascii?Q?Za6SaCol73+8Ft9nAo/CGXiy8lGUG2zCLQFkU8AeYu9HfiIn/YrS2e+oWmn7?= =?us-ascii?Q?SVIJImCfLGr+LlXeXG+Ku1q/p+0Kl6fiIhDfbwfxxjPSJeVnRequ9BaQ9nI+?= =?us-ascii?Q?U2zQixSB4fLz1jt/wgdd+gOu8ttbQl56Cej2V17/AIHFX9pCf6btatjFDhIo?= =?us-ascii?Q?ty+UR4ZuZ+iPoQIlcRAq5dLPFUNfF3wlLtylsgLHiFgj2tvRU4ADZftDYDLf?= =?us-ascii?Q?b+ABnWX+Xr8wr4GRvqKjKJYWV3mDWvJpJLW/Xz78vOZ9N52nlM8leorZWdzV?= =?us-ascii?Q?BBVBDCsmkahhvWpFQG55oiFXgV1IoODU5s1JuTp/2yMTx9mD2/viZ4tReSbs?= =?us-ascii?Q?Rd36qsLjLL2CbxY98Jc2bsrIwnBziBdx3+3c/V/0sh3kCB4hAoS/sT+N56uo?= =?us-ascii?Q?3uzjH1zyga7uPUWlp67P0doRQIWXFT8bo0JAxPjp+bMp/pYjdSJwsalXOJE1?= =?us-ascii?Q?tDX8NlczOqMGwQ2CEn+SuiUYdrMmJtMxvoOJXf1Oxc2RbSBuzOYcTmDlSb58?= =?us-ascii?Q?MdJVg+cS16MnT/kBxwotxn83+vb4xUIb8C6zBWsmSsevJ77Oty6Iq6ym5i0+?= =?us-ascii?Q?rfQ+BBA+PBtyxnyZkkd/R4M5eJ+UlrDRkyvdPp4QHQ+bi7KI5jCL7mmegGhc?= =?us-ascii?Q?Cr/l5m+iBH6lVpMwiItwVk0EUITJFbiahYfjUCa914X5WijIDbtVl4kv9cvS?= =?us-ascii?Q?W8AEFYFkZTVchpmg5UiUQeR6Yt3vdQbOVH5SU2TMtSm6f3Y8MtavFMvyoqlS?= =?us-ascii?Q?oTIbPwqJc58QLsG0QslmaQz?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0720; 5:lP0IZ5Wzzmx/BEm4qWCyUS2apUW1HWHiqkqX4L/DtHNoBs/vdPwedemyymjrAD3VP3msvVN/Mmv9pYgrrXbisABEEMJS48A1pyOYD9OymX293oSRZvbU65DFeBNRCZT0UYJzh/qt5hllWkjnGCO4NA==; 24:RZxswEq2kM3WW+yPssAg5LTsXPLu9dC+rV4hrDpQfVFeo+6yKTGQ+tnG1TIH/zeouxDcPQKIuz94VeFi667v/NzEAYi53bhSNJ6DQsqi4+A=; 20:9NaCnLtamBz5/b9oNR68JR1ns1juI8BgsGAHeXNTcGZGtolkJySbP4emiSxNUyG9EDAmm9ZOtfGDzleTN1LYwT3i4sErykRwMz3ce1dQYVxgIvys1ansAnRlNlE8LQKLqF8dxuVlueZLoes8Z/3CyHpNuAVKsHSK774qPZTssWSQWABJEURWC9WAcxftkmA2lmgSyj9GVL0QA1Jqoibt187zVj1YTsyIqH98r3Oe9pb/n3esKboTY3g9CRTqcjs3 SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2015 18:47:49.7730 (UTC) X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.221]; Helo=[atltwp01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0720 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151021_114815_093079_F40C520F X-CRM114-Status: GOOD ( 14.00 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>, graeme.gregory@linaro.org, Catalin Marinas <Catalin.Marinas@arm.com>, dhdang@apm.com, Will Deacon <will.deacon@arm.com>, linux-kernel@vger.kernel.org, tomasz.nowicki@linaro.org, linux-acpi@vger.kernel.org, hanjun.guo@linaro.org, Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> 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=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED, 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 |
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index 1d0e768..6685b33 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -939,7 +939,7 @@ static int gic_irq_domain_translate(struct irq_domain *d, return 0; } - if (fwspec->fwnode->type == FWNODE_IRQCHIP) { + if (is_fwnode_irqchip(fwspec->fwnode)) { if(fwspec->param_count != 2) return -EINVAL; diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index d5e5c5b..4950a71 100644 --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h @@ -211,6 +211,11 @@ static inline struct fwnode_handle *of_node_to_fwnode(struct device_node *node) return node ? &node->fwnode : NULL; } +static inline bool is_fwnode_irqchip(struct fwnode_handle *fwnode) +{ + return fwnode && fwnode->type == FWNODE_IRQCHIP; +} + static inline struct irq_domain *irq_find_matching_host(struct device_node *node, enum irq_domain_bus_token bus_token) { diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 22aa961..7f34d98 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -70,7 +70,7 @@ void irq_domain_free_fwnode(struct fwnode_handle *fwnode) { struct irqchip_fwid *fwid; - if (WARN_ON(fwnode->type != FWNODE_IRQCHIP)) + if (WARN_ON(!is_fwnode_irqchip(fwnode))) return; fwid = container_of(fwnode, struct irqchip_fwid, fwnode);
Since there will be several places checking if fwnode.type is equal FWNODE_IRQCHIP, this patch adds a convenient function for this purpose. Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> --- drivers/irqchip/irq-gic.c | 2 +- include/linux/irqdomain.h | 5 +++++ kernel/irq/irqdomain.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-)