From patchwork Fri Sep 20 21:19:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 20491 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f198.google.com (mail-ve0-f198.google.com [209.85.128.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E140723906 for ; Fri, 20 Sep 2013 21:19:45 +0000 (UTC) Received: by mail-ve0-f198.google.com with SMTP id c14sf923737vea.1 for ; Fri, 20 Sep 2013 14:19:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=Dfw+IbixlKBmfC6OLtuTQcjbGdFFGuHMgmSNiJy3qQ8=; b=eJMq1PQ+dM02OGFjRpZS9n+LBDGYLzzFtqTfgeNum4CL8axZrUtEICEo/zAO5xxzgZ O5vOC/bDCqZUCsMey9CNxDQi64pewX/uL5CanKlKqJVdUtN09zuBreRiUZFM343zfW/m fSTIdgD3gr+fMQw9jrZKkPuEsxBr56lF+o81CB6u2f/GesWzn2qBlDoidZ4etcHq023F Jw++k2J8Alwm1GsAqsq1DHOeYdKoarU3GAD41gtVXKnQ1L/tPzhszyn7PoYyteeewZ/f KA3gMdfEfXNr/oV8MfgrkEOU3bjBxqyoe/dXAeni62EfvXoOQac1x/0HKxlRcJTyRH91 mkqQ== X-Gm-Message-State: ALoCoQll+8EuyWxZstYfr4dfzE4Sg3cUTUObUOjX1WzXv+dwntoX+UYgD7nWgtdqVNy0gRHyKmV4 X-Received: by 10.236.174.232 with SMTP id x68mr2144793yhl.42.1379711985393; Fri, 20 Sep 2013 14:19:45 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.71.83 with SMTP id s19ls408880qeu.7.gmail; Fri, 20 Sep 2013 14:19:45 -0700 (PDT) X-Received: by 10.58.108.74 with SMTP id hi10mr8475016veb.14.1379711985292; Fri, 20 Sep 2013 14:19:45 -0700 (PDT) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id tq4si3434758vdc.90.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 20 Sep 2013 14:19:45 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id jx11so780433veb.7 for ; Fri, 20 Sep 2013 14:19:45 -0700 (PDT) X-Received: by 10.52.103.35 with SMTP id ft3mr7094036vdb.5.1379711985202; Fri, 20 Sep 2013 14:19:45 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp39263vcz; Fri, 20 Sep 2013 14:19:44 -0700 (PDT) X-Received: by 10.14.225.199 with SMTP id z47mr13662862eep.24.1379711983942; Fri, 20 Sep 2013 14:19:43 -0700 (PDT) Received: from mail-ea0-f179.google.com (mail-ea0-f179.google.com [209.85.215.179]) by mx.google.com with ESMTPS id x42si12812607eel.86.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 20 Sep 2013 14:19:43 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.179 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=209.85.215.179; Received: by mail-ea0-f179.google.com with SMTP id b10so510820eae.38 for ; Fri, 20 Sep 2013 14:19:43 -0700 (PDT) X-Received: by 10.14.8.72 with SMTP id 48mr13459933eeq.25.1379711983413; Fri, 20 Sep 2013 14:19:43 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id r48sm22248512eev.14.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 20 Sep 2013 14:19:42 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Alexandre Courbot , Linus Walleij , Markus Mayer Subject: [PATCH v2] gpio: bcm-kona: only use set_irq_flags() on ARM Date: Fri, 20 Sep 2013 23:19:38 +0200 Message-Id: <1379711978-10973-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.8.3.1 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , As per the pattern from other GPIO drivers, use set_irq_flags() on ARM only, use irq_set_noprobe() on other archs. Also rename the argument "virq" to just "irq", this IRQ isn't any more "virtual" than any other Linux IRQ number, we use "hwirq" for the actual hw-numbers, "virq" is just bogus. Cc: Markus Mayer Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Forgot a second place the code was using set_irq_flags()... --- drivers/gpio/gpio-bcm-kona.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c index f7d932a..c0751a8 100644 --- a/drivers/gpio/gpio-bcm-kona.c +++ b/drivers/gpio/gpio-bcm-kona.c @@ -468,18 +468,22 @@ MODULE_DEVICE_TABLE(of, bcm_kona_gpio_of_match); */ static struct lock_class_key gpio_lock_class; -static int bcm_kona_gpio_irq_map(struct irq_domain *d, unsigned int virq, +static int bcm_kona_gpio_irq_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hwirq) { int ret; - ret = irq_set_chip_data(virq, d->host_data); + ret = irq_set_chip_data(irq, d->host_data); if (ret < 0) return ret; - irq_set_lockdep_class(virq, &gpio_lock_class); - irq_set_chip_and_handler(virq, &bcm_gpio_irq_chip, handle_simple_irq); - irq_set_nested_thread(virq, 1); - set_irq_flags(virq, IRQF_VALID); + irq_set_lockdep_class(irq, &gpio_lock_class); + irq_set_chip_and_handler(irq, &bcm_gpio_irq_chip, handle_simple_irq); + irq_set_nested_thread(irq, 1); +#ifdef CONFIG_ARM + set_irq_flags(irq, IRQF_VALID); +#else + irq_set_noprobe(irq); +#endif return 0; } @@ -598,7 +602,11 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev) irq_set_lockdep_class(irq, &gpio_lock_class); irq_set_chip_and_handler(irq, &bcm_gpio_irq_chip, handle_simple_irq); +#ifdef CONFIG_ARM set_irq_flags(irq, IRQF_VALID); +#else + irq_set_noprobe(irq); +#endif } for (i = 0; i < kona_gpio->num_bank; i++) { bank = &kona_gpio->banks[i];