From patchwork Wed Dec 9 19:24:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Suthikulpanit, Suravee" X-Patchwork-Id: 58178 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp31411lbb; Wed, 9 Dec 2015 11:25:17 -0800 (PST) X-Received: by 10.98.86.210 with SMTP id h79mr627084pfj.87.1449689117462; Wed, 09 Dec 2015 11:25:17 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xt4si10974766pab.131.2015.12.09.11.25.16; Wed, 09 Dec 2015 11:25:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754016AbbLITZG (ORCPT + 28 others); Wed, 9 Dec 2015 14:25:06 -0500 Received: from mail-bn1on0070.outbound.protection.outlook.com ([157.56.110.70]:45504 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753769AbbLITY6 (ORCPT ); Wed, 9 Dec 2015 14:24:58 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Suravee.Suthikulpanit@amd.com; Received: from ssuthiku-fedora-lt.amd.com (165.204.77.1) by BLUPR12MB0433.namprd12.prod.outlook.com (10.162.92.139) with Microsoft SMTP Server (TLS) id 15.1.355.16; Wed, 9 Dec 2015 19:24:52 +0000 From: Suravee Suthikulpanit To: , , , CC: Lorenzo Pieralisi , Will Deacon , Catalin Marinas , , , , , , , , Suravee Suthikulpanit Subject: [PATCH v6 2/4] irqdomain: introduce is_fwnode_irqchip helper Date: Wed, 9 Dec 2015 11:24:32 -0800 Message-ID: <1449689074-30609-3-git-send-email-Suravee.Suthikulpanit@amd.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1449689074-30609-1-git-send-email-Suravee.Suthikulpanit@amd.com> References: <1449689074-30609-1-git-send-email-Suravee.Suthikulpanit@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: CY1PR20CA0108.namprd20.prod.outlook.com (25.164.213.162) To BLUPR12MB0433.namprd12.prod.outlook.com (25.162.92.139) X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0433; 2:0I5d77oiEQs4j0Eij2/Owm6Zz2sc3sczFhR9yJUhVwdsBvPd7GawcVVyxIm8V42soc5t/xNJYLDKqpUV9eaYdrq0/tafhU1vl+lRvDJcqjP6RYqHVr6KCXwECDTDLKe6QZV5uACANLFo8LJPSpioUg==; 3:xzM5AJ97qZ+hCnWz+kSQkvq062juFsgnskiaTO4K8Ji6euQWvJ1ZWZLdGkzrzc4iNFI69LXBL4i1iTRyNXAfSEvo88RH8lrOwA1xzfM9Te7jGbdjYMKR7++DoomwQJxy; 25:UK//fnq8td8SVKFbxV8mW0sizSQux/T529BUnBNvHlbX2HdJycJhOLct0uE3dR/GXEqzg/7Hx1SNJ0/wNVVFWP5nSqaceuFp6phosVSMBk2tPWw9QzwcTi5+/dchfGIIdWku9R2R0wLo+0xmZbDPC6VjURt6quOLcV4TPfhPPr2fWPMjcOU5NDDH1k/oExKCSjZt1d6+L80h7Pm7Kyp705vwiaHox+NbHmRozizYarwfMWTHXryJ/KOwHJnZuizL/ZpQEfe0phWFZl4uUON/Ow== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR12MB0433; X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0433; 20:1JjZwmJGF/Z2Y58PQ2v5Hg8zUrt+wyAjjPJa+FboNi+Izkeowj1ba1/FWc5/dYISNEQSMZrHO8wOc5iZSqTH4NdM15wfYrOnUEl19UaNBQ76MlPzJetD1sgb0hj+O4MIeSzjyVKYNG8j3ihkMOxkeaapZOvA0zS7vMa4F74uom9ZMFHa8T0aWwMjZwA3Id8q8hSZODgvVE1TFesq3wIgxikTw3/dfaCcDH8syOJt5x1moaImiCljmfS/k4aPBCl7DhfOkjVcbpLRY8RuRelE/Mzevmmd5JmchTFK5WZCq/PyI4BTcRLlfIQHiQIx5FR3+P22N7Vmx7l7q8gPKCRZooXpeQzDg2Lw/Wgq2Bh1PQa2CETJA/6UXS/x61j5U3k2NGEOVRqH+fxLfEBX8QtNUIWBtUmC+mfMvO8lyXW5azlRNOGbQ/Wn3eqW66Sn1eWW+6GIrSaX+Lb9JIwBUoKqZFXNTAdG4aZyNXq71W39T4tgobsoOjhBriLhQ3Wva1mq X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(180628864354917); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(520078)(3002001)(10201501046); SRVR:BLUPR12MB0433; BCL:0; PCL:0; RULEID:; SRVR:BLUPR12MB0433; X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0433; 4:LQ6QDJL3mJ9gXzla15qjoREfNCCdzUJm7BY9TvacERhHrz2sMjJqmMxzan77PuhMVXZkw+VSjqdtmM+Zen+4f+SO5odwlKMWjlE+22DwmRnCsou7e/Br27d8sTsz/9VOxf2tmRkPAFCBkRHUPONdHHsbndniHxkuuGdHgygR0aMj8QzFQAK582hGWDsWQdmeWLIsS7+ouyY9G8OHY4/cLlW6zPXnHTRbzkwWduOwCwCxxyLXd2DkIrPDeEkOjNfPYuRgtsNNMVOgNAL4to6a3YVklgNRaFT7uYtXBOsjtS+RUPK6c1CWJaRtpG+vOQ8HBxXRpAj+q6Bq3T1l2OQE+LYbEpAtQceWsOey8J9Yn5urR9FoaHu6WoGnMr3CFbiomYTPuac4LsOJLhTilywHlUMqqDpN/7+W6p7/GROIGGlqLGSShcKa74NiAb+q9kfaWGQHDBGuHCLQKC000je/nQ== X-Forefront-PRVS: 0785459C39 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(199003)(189002)(5001770100001)(50226001)(122386002)(229853001)(36756003)(42186005)(106356001)(105586002)(5004730100002)(86362001)(5003940100001)(2201001)(66066001)(47776003)(53416004)(92566002)(76176999)(97736004)(586003)(189998001)(101416001)(5008740100001)(1096002)(50986999)(50466002)(40100003)(3846002)(2950100001)(77096005)(6116002)(48376002)(87976001)(19580395003)(19580405001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR12MB0433; H:ssuthiku-fedora-lt.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR12MB0433; 23:89AUGIRbN6l8sTOck2BCRCoWi85GlQT9w5DTfEtBG?= =?us-ascii?Q?Pix8KNCrsDVQKczvovLTtsLuUNTyZ4+Y0+GotmvbabnVeuRrKCxr4aBNPX90?= =?us-ascii?Q?HimSHkg4R2sXvGhuA/wFazN1eLWR9BfFvB2GQixawuTzhg98M9tDz57w2Kh8?= =?us-ascii?Q?ESq6oOBo1/3jCb779Sr2ODkHCL670OVv+g4lHoiJPKFS9FCKNpJCUgp+bm4l?= =?us-ascii?Q?zkLbdPqC3mgY8w0OsBQ+PxUFf7MNWxByqj/cKHlUe53Y8doCubrNcLmCDsKI?= =?us-ascii?Q?/3RfdEz7/8KCHCFDct14nsTQQcGOksL/by5P2AKwXUEmgzbNF1HMtbr1rEbU?= =?us-ascii?Q?Q8iupOHkuPC9uoqDrZPtUW0z1Iq0Xg+ClZhu2f2rbk8VfKT48nkzyE8YFogO?= =?us-ascii?Q?fysBWe02EGVENG1VZdaC9yU62Tealw/9HT1yOy8SEaY2Moi9LAHBcOJLJ3/F?= =?us-ascii?Q?iMdUUMn8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IlXv0wTcEtuhEo+H2sCC9T325pR/mb6d0MJqYWLnuqedDSHjCebbogqZSL8ewzd+v1oKqq+kXaJ3k1mrs6Qm3pdFSi/DG8gFKi1QqduuRiRKxmt8CJwy6gEkYJ7PmEotiX+KBk/UcsdUBrQiGhhWdQIKv X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2015 19:24:52.3130 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR12MB0433 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since there will be several places checking if fwnode.type is equal FWNODE_IRQCHIP, this patch adds a convenient function for this purpose. Acked-by: Marc Zyngier 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(-) -- 2.1.0 -- 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/ diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index abf2ffa..fcd327f 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -972,7 +972,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 a06feda..d72fabc 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);