Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756448Ab2JRO4Q (ORCPT ); Thu, 18 Oct 2012 10:56:16 -0400 Received: from mail-oa0-f46.google.com ([209.85.219.46]:34139 "EHLO mail-oa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752830Ab2JRO4P (ORCPT ); Thu, 18 Oct 2012 10:56:15 -0400 Message-ID: <5080188D.2010000@gmail.com> Date: Thu, 18 Oct 2012 09:56:13 -0500 From: Rob Herring User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Shawn Guo CC: Linus Walleij , linux-kernel@vger.kernel.org, Grant Likely Subject: Re: [PATCH 4/7] gpio/mxs: convert to use linear irqdomain References: <1350415376-3217-1-git-send-email-linus.walleij@linaro.org> <20121018062208.GB4513@S2101-09.ap.freescale.net> In-Reply-To: <20121018062208.GB4513@S2101-09.ap.freescale.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2706 Lines: 71 On 10/18/2012 01:22 AM, Shawn Guo wrote: > On Tue, Oct 16, 2012 at 09:22:56PM +0200, Linus Walleij wrote: >> The MXS driver tries to do the work of irq_domain_add_linear() >> by reserving a bunch of descriptors somewhere and keeping track >> of the base offset, then calling irq_domain_add_legacy(). Let's >> stop doing that and simply use the linear IRQ domain. >> >> Cc: Rob Herring >> Cc: Grant Likely >> Cc: Shawn Guo >> Signed-off-by: Linus Walleij >> --- >> drivers/gpio/gpio-mxs.c | 19 ++++++------------- >> 1 file changed, 6 insertions(+), 13 deletions(-) >> >> diff --git a/drivers/gpio/gpio-mxs.c b/drivers/gpio/gpio-mxs.c >> index 796fb13..71fd5b1 100644 >> --- a/drivers/gpio/gpio-mxs.c >> +++ b/drivers/gpio/gpio-mxs.c >> @@ -223,7 +223,6 @@ static int __devinit mxs_gpio_probe(struct platform_device *pdev) >> static void __iomem *base; >> struct mxs_gpio_port *port; >> struct resource *iores = NULL; >> - int irq_base; > > ... > >> int err; >> >> port = devm_kzalloc(&pdev->dev, sizeof(*port), GFP_KERNEL); >> @@ -272,16 +271,10 @@ static int __devinit mxs_gpio_probe(struct platform_device *pdev) >> /* clear address has to be used to clear IRQSTAT bits */ >> writel(~0U, port->base + PINCTRL_IRQSTAT(port) + MXS_CLR); >> >> - irq_base = irq_alloc_descs(-1, 0, 32, numa_node_id()); >> - if (irq_base < 0) >> - return irq_base; >> - >> - port->domain = irq_domain_add_legacy(np, 32, irq_base, 0, >> + port->domain = irq_domain_add_linear(np, 32, >> &irq_domain_simple_ops, NULL); >> - if (!port->domain) { >> - err = -ENODEV; >> - goto out_irqdesc_free; >> - } >> + if (!port->domain) >> + return -ENODEV; >> >> /* gpio-mxs can be a generic irq chip */ >> mxs_gpio_init_gc(port, irq_base); > ^^^^^^^^ > > So I know this one is not compile-tested. > > This is exactly the reason why I have to use irq_domain_add_legacy > other than irq_domain_add_linear when I add irqdomain support for the > driver. The driver uses generic-irq infrastructural which needs > irq_base for setup. So sadly, before generic-irq gets improved, any > irq chip that uses generic-irq will have to use irq_domain_add_legacy. We should get someone to work on that. ;) I think I need to go back and just fix this aspect rather than try and integrate irqdomains into generic-irqchip. Rob -- 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/