Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755026AbcCaIH5 (ORCPT ); Thu, 31 Mar 2016 04:07:57 -0400 Received: from mail.kernel.org ([198.145.29.136]:54514 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751479AbcCaIHv (ORCPT ); Thu, 31 Mar 2016 04:07:51 -0400 Date: Thu, 31 Mar 2016 16:07:25 +0800 From: Shawn Guo To: Stefan Agner Cc: mturquette@baylibre.com, sboyd@codeaurora.org, kernel@pengutronix.de, sergeimir@emcraft.com, tglx@linutronix.de, jason@lakedaemon.net, marc.zyngier@arm.com, robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org Subject: Re: [PATCH 01/18] irqchip: vf610-gpc: add Vybrid GPC IRQ controller Message-ID: <20160331080725.GU28207@tiger> References: <1457576219-7971-1-git-send-email-stefan@agner.ch> <1457576219-7971-2-git-send-email-stefan@agner.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1457576219-7971-2-git-send-email-stefan@agner.ch> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1143 Lines: 42 On Wed, Mar 09, 2016 at 06:16:42PM -0800, Stefan Agner wrote: > +static int __init vf610_gpc_of_init(struct device_node *node, > + struct device_node *parent) > +{ > + struct irq_domain *domain, *domain_parent; > + int i; > + > + domain_parent = irq_find_host(parent); > + if (!domain_parent) { > + pr_err("vf610_gpc: interrupt-parent not found\n"); > + return -EINVAL; > + } > + > + gpc_base = of_io_request_and_map(node, 0, "gpc"); > + if (WARN_ON(!gpc_base)) of_io_request_and_map() doesn't return NULL for error but an error code encoded by ERR_PTR(). That said, you should use IS_ERR(gpc_base) rather than !gpc_base for error check. Shawn > + return PTR_ERR(gpc_base); > + > + domain = irq_domain_add_hierarchy(domain_parent, 0, VF610_GPC_MAX_IRQS, > + node, &gpc_irq_domain_ops, NULL); > + if (!domain) { > + iounmap(gpc_base); > + return -ENOMEM; > + } > + > + /* Initially mask all interrupts for wakeup */ > + for (i = 0; i < IMR_NUM; i++) > + writel_relaxed(~0, gpc_base + VF610_GPC_IMR1 + i * 4); > + > + return 0; > +} > +IRQCHIP_DECLARE(vf610_gpc, "fsl,vf610-gpc", vf610_gpc_of_init); > -- > 2.7.2 > >