From patchwork Wed Oct 14 23:25:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suravee Suthikulpanit X-Patchwork-Id: 7399121 Return-Path: X-Original-To: patchwork-linux-acpi@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 DAB839F1B9 for ; Wed, 14 Oct 2015 23:27:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 428E2209D7 for ; Wed, 14 Oct 2015 23:27:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 44663209D4 for ; Wed, 14 Oct 2015 23:27:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754782AbbJNX0T (ORCPT ); Wed, 14 Oct 2015 19:26:19 -0400 Received: from mail-bn1bon0062.outbound.protection.outlook.com ([157.56.111.62]:62400 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753766AbbJNXZz (ORCPT ); Wed, 14 Oct 2015 19:25:55 -0400 Received: from CY1PR12CA0014.namprd12.prod.outlook.com (10.160.137.24) by SN1PR12MB0863.namprd12.prod.outlook.com (10.164.27.13) with Microsoft SMTP Server (TLS) id 15.1.300.14; Wed, 14 Oct 2015 23:25:52 +0000 Received: from DM3NAM03FT007.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::205) by CY1PR12CA0014.outlook.office365.com (2a01:111:e400:4c1f::24) with Microsoft SMTP Server (TLS) id 15.1.300.14 via Frontend Transport; Wed, 14 Oct 2015 23:25:52 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.222) 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 atltwp02.amd.com (165.204.84.222) by DM3NAM03FT007.mail.protection.outlook.com (10.152.82.68) with Microsoft SMTP Server id 15.1.300.4 via Frontend Transport; Wed, 14 Oct 2015 23:25:51 +0000 X-WSS-ID: 0NW8H2X-08-IVH-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 atltwp02.amd.com (Axway MailGate 5.3.1) with ESMTPS id 2DA4EBD88D6; Wed, 14 Oct 2015 19:25:44 -0400 (EDT) Received: from SATLEXDAG02.amd.com (10.181.40.5) by SATLVEXEDGE02.amd.com (10.177.96.29) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 14 Oct 2015 18:25:51 -0500 Received: from ssuthiku-fedora-lt.amd.com (10.180.168.240) by SATLEXDAG02.amd.com (10.181.40.5) with Microsoft SMTP Server id 14.3.266.1; Wed, 14 Oct 2015 19:25:47 -0400 From: Suravee Suthikulpanit To: , , , CC: Lorenzo Pieralisi , Will Deacon , Catalin Marinas , , , , , , , , Suravee Suthikulpanit Subject: [PATCH V2 3/6] irqdomain: introduce is_fwnode_irqchip helper Date: Wed, 14 Oct 2015 16:25:53 -0700 Message-ID: <1444865156-9870-4-git-send-email-Suravee.Suthikulpanit@amd.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1444865156-9870-1-git-send-email-Suravee.Suthikulpanit@amd.com> References: <1444865156-9870-1-git-send-email-Suravee.Suthikulpanit@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.222; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(428002)(189002)(199003)(229853001)(106466001)(36756003)(5007970100001)(101416001)(76176999)(48376002)(11100500001)(50226001)(189998001)(2950100001)(92566002)(46102003)(53416004)(105586002)(50466002)(5003600100002)(5003940100001)(19580395003)(5008740100001)(5001770100001)(5001920100001)(2201001)(575784001)(77096005)(97736004)(19580405001)(87936001)(50986999)(47776003)(64706001)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0863; H:atltwp02.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0863; 2:IRPtBYHHQI+vqs1vRRSThcngk+c2hQ/COjBVtpUgaaOseQYhxrpr2KJW9B9ovBuBN4wH9uFQJI+HTvtir8n1ctfnNXo4QUyep64Ur8rNbL8pwPa57D9whlz5U6O3zzya45oa86MP1oQ910W04iXjHdSZXrC7QhsW/nLTVNKbwqg=; 3:tjEit7eU1Kf7Cg7MHhKHgyFDPPZfK9wH9TP22ogoHFBvy2JKG1WgLxNIa0q0LcRT/faYxfkceFBhH59Gu+1aABMaYJDvqlm51H/d0dgkUQyUoy6guiwfLqMsGFH2BrWlY/QVuA8G7QNBto4YYRl98rJMCrzvbda79MBeSrbqRgHbX67AxZAcWEIcHWhfAgUPcboeOp8fv2Y6idD2sRQ9PbSaMhk8mZyoOlnTyND3PrpkkL96nF9Nuc9GmqKyPlav; 25:nFvlNdT1kA02zslHinC1TzZZEEMY16Rg7OgpZByQ3HAs38mpz17rpzB3AdrAZcM+nW6C+LJMkvYHllWkVPpWP4qlKrZGYiP34aHA4ZBRuy0pwc8pNVpXLLg5Q6K0IGTKFqK+tHIordWagWAmZfMC/IYeEGp+v9nInGIKjRXrznCGwMs0i8pp+CEUrFdfMMJrZPlveRgXRb4G9FTI3Sy9PJCJbyDw5OACzpY3xYcz+JQAb221zBh/Y9bZ4suJeiVx2bB6GExnL5lEcf2jdvKapA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR12MB0863; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0863; 20:mHL/lWjY80lhxJJ75DCl+SNR8BAql1lPRZJGcIt3OwszgfPSctxNSqMxK8lVRGv2PWGW4W6yI3iaUA/KzQ/NPbx+dcIx+9Rhf+RzG0jLEwMP0ha13QVGiPDJTVAM1lLHZKmHt7vzsT9g7iq2mjRcNO3+I9d8Ze+FiYmo+fuvq3he8+8MvX3YcHVcFTPSw0wsmVtM3fY7HdH+g1bAjWG5WuwJ2s6KvAAuLwrPfE6LgsxzD0LFX5DUN9uyoGkV6Wd6DBl2zCMwXf6MsxrBHwBTKmcJo7eRGwh8h7LsJFf3n444+P4nwcRN3VSAZpMCRo8qCykDxytUckb8Ww72hPALg/ljf9VMZjlnkbNnAkBFJlzjuCM9+0hxxo/XtNQGgdiJ9XgpqpMPiZunB3I9pwjn+BvNUOE5bxGK04c+kzQp7dJCsLtJzVRSu1F/FCBTdOql+rZ2hKMPJaKfhDWSwCFGMnJdZsOQAMBS5LarkDOmPK94UlzFE9+xpRm9+18y/usY; 4:HlHerOgCFI2p69Ga1ggyVspMRuMwkxEFjquwqVgc2Q/UYPSq9f5g1xDlkhPMY6Y1DRYhtofAmGrxCEYW/zOs9Z54MzFUF+YnYQgYQs9xUAYJ7i1IxpQSdd9LKW49ZNllV/SaggEQzRUn0DYs+2ZF6w8v2Aaz3idAGNCYZv6HmuBmNz6GaKX1vEOvfFZZtqHZKhQKNYqSs3Kzq1cYZRkrjp7WOi25mBZxZfSq9+j3M38TDd6DH6lqLGPQf6yZ3HKS07uW3iNleKrIkiVTc2YqG1MnuS0+pepwcm+F3IU6xP8t/1pGhQ0QSKX7LC5nGy+orl3qSiAEHKGVKdWjw7ddVWpihORFdkd/vGTc/iIt1rs= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(520078)(3002001); SRVR:SN1PR12MB0863; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0863; X-Forefront-PRVS: 0729050452 X-Microsoft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SDo5rvjvHs2Oc9HI2mLmT7Uy6sEEU8ycscV/1AEgz9oAw?= =?us-ascii?Q?EsBLqRxlB6KclCHX2DVtAdm23DO8hmD69Y6cGUky4fDTtxOpfK2UtQDBu6Nj?= =?us-ascii?Q?Vr3SDfkxzHeGE1ye/GYaM/zxeCKmcL0EJN7B/0zy8HgxY6xyonAefh3IcFTk?= =?us-ascii?Q?UULgAPWI58JBxXlaUasUlOIQm8hRoR04sJtdkCDOIT5PA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0863; 5:Sqahu2w5b28ykQ4pauhp4oj7NOt7C6EvHHQBVycD2mEi9psvbcluSYNaiQAGOZ7ho599iMQ43wMBR3gCu6jIeOTy0plvqYyS5fg/8XhCzmeZC9HjlHhtIvamd0W/VyNCq2c4x9U3OlebbNs32dw8FQ==; 24:kHdvqBHlrnLo9MYIig3jV8NV00nCIRJZurOwW1//6a379RtLJC22KF2eALHSbQsFWUEby2gMFkhwxD+UofGzLXLZau7MHNWwKEyuwOVZkX8=; 20:GpIM8FoRpbHcnW9+rl/0KBwYGHsNNXyA56j5bhJowwNFRXpLLIhIl5pN/OHRKqTSJxYeAnbNfH1pv+4hSmxf+Vlj0Qaap5wntIJOlEtc9i7Cw68vB0Hda6ZKdQEQoMA+Xzlp2R2SpzMFLrL4fSvFC+wgLD2LqaoQmuYs1o7r0ZQKtbEshtfcky/1WD6KQwyA/KrJHSk+RNfsG1WXsafrQJ1wNFCP6CW+fTuGG70r3Pou02z2WsYPMhoJaDkEighn SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2015 23:25:51.4381 (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.222]; Helo=[atltwp02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0863 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 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 --- drivers/irqchip/irq-gic.c | 2 +- include/linux/irqdomain.h | 5 +++++ kernel/irq/irqdomain.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) 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);