From patchwork Thu Oct 11 14:36:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 12167 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 152E823FB3 for ; Thu, 11 Oct 2012 14:37:01 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id AC28AA19229 for ; Thu, 11 Oct 2012 14:37:00 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so3004287iej.11 for ; Thu, 11 Oct 2012 07:37:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :x-gm-message-state; bh=S4k54CCOvhMKkqHbinflFvH39vBr0nT5LDMuseRRHUc=; b=hflxWHSEKCK3B2OUAD5aI8e7jEETwDa9xef74J1kELM67B/KF1vIR1UH5sNCvMA+mE 9rYgfnIy4CfF7o96AKQycOSzKCsh06OP2PhP/yvKKa2omJ2PEgIlIUNn2fm7fto8APLP h5K1M6/prOxdbWbLF567vSHpErohqM+b3nNhL3ruqNIduqh6M3A0uvCInytOLEcs91qv 2t7DgiTKyF3Uamwdk5x2IG/xqVfJ3I+MuxQAv4D4w9qsFtMAZscgkvZDCshVb9dI5GIb qUAM0B5TFuVFihPmzAdKtecvU+xyoHStucTzB5wVSR1a/FXnLshl3gGLimu28g+BZpvH gBYg== Received: by 10.43.7.132 with SMTP id oo4mr883415icb.6.1349966220001; Thu, 11 Oct 2012 07:37:00 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp44215igt; Thu, 11 Oct 2012 07:36:58 -0700 (PDT) Received: by 10.14.194.2 with SMTP id l2mr1894712een.12.1349966217588; Thu, 11 Oct 2012 07:36:57 -0700 (PDT) Received: from eu1sys200aog103.obsmtp.com (eu1sys200aog103.obsmtp.com [207.126.144.115]) by mx.google.com with SMTP id q5si4041898eep.21.2012.10.11.07.36.50 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 11 Oct 2012 07:36:57 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.115 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.115; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.115 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob103.postini.com ([207.126.147.11]) with SMTP ID DSNKUHbZgO5kO52o/IMXFrZxTM+jZbDNPRzn@postini.com; Thu, 11 Oct 2012 14:36:57 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id EB0632EF; Thu, 11 Oct 2012 14:36:44 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 4D20847CB; Thu, 11 Oct 2012 14:36:44 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id F2E36A8065; Thu, 11 Oct 2012 16:36:37 +0200 (CEST) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.83.0; Thu, 11 Oct 2012 16:36:43 +0200 From: Linus Walleij To: , Cc: Stephen Warren , Anmar Oueja , Linus Walleij , Lee Jones , Rob Herring Subject: [PATCH] pinctrl/nomadik: always use the simple irqdomain Date: Thu, 11 Oct 2012 16:36:37 +0200 Message-ID: <1349966197-18777-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.11.3 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQnGQoZMhMF8mjgTLzYxUEVFY5bKXtaY96lb2PmnCDR7BT+Lip7PrHNeUT1SRynFlJzC+YGq From: Linus Walleij Since the simple irqdomain will fall back to a linear domain if the first_irq provided is <= 0, just use this, just make sure the first_irq is negative in the device tree case. Cc: Lee Jones Cc: Rob Herring Signed-off-by: Linus Walleij --- drivers/pinctrl/pinctrl-nomadik.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c index 992982c..a4a4247 100644 --- a/drivers/pinctrl/pinctrl-nomadik.c +++ b/drivers/pinctrl/pinctrl-nomadik.c @@ -1277,6 +1277,7 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev) struct clk *clk; int secondary_irq; void __iomem *base; + int irq_start = -1; int irq; int ret; @@ -1380,19 +1381,11 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev) platform_set_drvdata(dev, nmk_chip); - if (np) { - /* The DT case will just grab a set of IRQ numbers */ - nmk_chip->domain = irq_domain_add_linear(np, NMK_GPIO_PER_CHIP, - &nmk_gpio_irq_simple_ops, nmk_chip); - } else { - /* Non-DT legacy mode, use hardwired IRQ numbers */ - int irq_start; - + if (!np) irq_start = NOMADIK_GPIO_TO_IRQ(pdata->first_gpio); - nmk_chip->domain = irq_domain_add_simple(NULL, + nmk_chip->domain = irq_domain_add_simple(NULL, NMK_GPIO_PER_CHIP, irq_start, &nmk_gpio_irq_simple_ops, nmk_chip); - } if (!nmk_chip->domain) { dev_err(&dev->dev, "failed to create irqdomain\n"); ret = -ENOSYS;