From: 21cnbao@gmail.com (Barry Song)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/4] pinctrl: sirf: move to use irq_get_handler_data
Date: Tue, 15 Apr 2014 14:43:49 +0800 [thread overview]
Message-ID: <1397544229-20545-5-git-send-email-21cnbao@gmail.com> (raw)
In-Reply-To: <1397544229-20545-1-git-send-email-21cnbao@gmail.com>
From: Barry Song <Baohua.Song@csr.com>
we set bank as handler_data, now we can get bank in ISR directly
instead of looking-up.
Signed-off-by: Barry Song <Baohua.Song@csr.com>
---
drivers/pinctrl/sirf/pinctrl-sirf.c | 12 ++----------
1 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/pinctrl/sirf/pinctrl-sirf.c b/drivers/pinctrl/sirf/pinctrl-sirf.c
index c03dcc7..36cc678 100644
--- a/drivers/pinctrl/sirf/pinctrl-sirf.c
+++ b/drivers/pinctrl/sirf/pinctrl-sirf.c
@@ -568,18 +568,10 @@ static struct irq_chip sirfsoc_irq_chip = {
static void sirfsoc_gpio_handle_irq(unsigned int irq, struct irq_desc *desc)
{
- struct sirfsoc_gpio_bank *bank;
+ struct sirfsoc_gpio_bank *bank = irq_get_handler_data(irq);
u32 status, ctrl;
int idx = 0;
struct irq_chip *chip = irq_get_chip(irq);
- int i;
-
- for (i = 0; i < SIRFSOC_GPIO_BANK_SIZE; i++) {
- bank = &sgpio_chip.sgpio_bank[i];
- if (bank->parent_irq == irq)
- break;
- }
- BUG_ON (i == SIRFSOC_GPIO_BANK_SIZE);
chained_irq_enter(chip, desc);
@@ -845,7 +837,7 @@ static int sirfsoc_gpio_probe(struct device_node *np)
goto out;
}
- gpiochip_set_chained_irqchip(&sgpio_chip.chip.gc,
+ gpiochip_set_chained_irqchip(bank,
&sirfsoc_irq_chip,
bank->parent_irq,
sirfsoc_gpio_handle_irq);
--
1.7.5.4
next prev parent reply other threads:[~2014-04-15 6:43 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-15 6:43 [PATCH 0/4] pinctrl: sirf: switch to one gpiolib and gpiolib_irqchip helpers Barry Song
2014-04-15 6:43 ` [PATCH 1/4] pinctrl: sirf: wrap all gpio banks into one gpio_chip Barry Song
2014-04-22 18:27 ` Linus Walleij
2014-04-23 20:03 ` Linus Walleij
2014-04-15 6:43 ` [PATCH 2/4] pinctrl: sirf: switch driver to use gpiolib irqchip helpers Barry Song
2014-04-23 20:04 ` Linus Walleij
2014-04-15 6:43 ` [PATCH 3/4] gpio: make handler_data configurable while using gpiolib_irqchip Barry Song
2014-04-23 20:13 ` Linus Walleij
2014-04-23 22:55 ` Barry Song
2014-04-23 23:09 ` Linus Walleij
2014-04-23 23:23 ` Barry Song
2014-04-24 13:06 ` Linus Walleij
2014-04-24 15:43 ` Barry Song
2014-04-15 6:43 ` Barry Song [this message]
2014-04-23 20:17 ` [PATCH 4/4] pinctrl: sirf: move to use irq_get_handler_data Linus Walleij
2014-04-23 22:59 ` Barry Song
2014-04-24 12:59 ` Linus Walleij
2014-04-24 15:45 ` Barry Song
2014-04-16 9:54 ` [PATCH 0/4] pinctrl: sirf: switch to one gpiolib and gpiolib_irqchip helpers Javier Martinez Canillas
2014-04-16 10:05 ` Barry Song
2014-04-16 10:20 ` Javier Martinez Canillas
2014-04-22 21:47 ` Linus Walleij
2014-04-23 12:09 ` Barry Song
2014-04-23 20:02 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1397544229-20545-5-git-send-email-21cnbao@gmail.com \
--to=21cnbao@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).