gpio: Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc
authorJiang Liu <jiang.liu@linux.intel.com>
Thu, 4 Jun 2015 04:13:15 +0000 (12:13 +0800)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 14 Jul 2015 10:12:20 +0000 (12:12 +0200)
Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc while we
already have a pointer to corresponding irq_desc.

Preparatory patch for the removal of the 'irq' argument from irq flow
handlers.

Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
drivers/gpio/gpio-bcm-kona.c
drivers/gpio/gpio-dwapb.c
drivers/gpio/gpio-mvebu.c
drivers/gpio/gpio-mxc.c
drivers/gpio/gpio-mxs.c
drivers/gpio/gpio-omap.c
drivers/gpio/gpio-tegra.c
drivers/gpio/gpio-timberdale.c
drivers/gpio/gpio-vf610.c
drivers/gpio/gpio-zynq.c

index 40343fa92c7b9c344f1f86a824bdb779ab8dd91e..109083f65248694c4f06dfbe4d16788562f3a49b 100644 (file)
@@ -438,7 +438,7 @@ static void bcm_kona_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
        void __iomem *reg_base;
        int bit, bank_id;
        unsigned long sta;
-       struct bcm_kona_gpio_bank *bank = irq_get_handler_data(irq);
+       struct bcm_kona_gpio_bank *bank = irq_desc_get_handler_data(desc);
        struct irq_chip *chip = irq_desc_get_chip(desc);
 
        chained_irq_enter(chip, desc);
index 55fa9853a7f2207984c0e99d3e1cee2c49ad788d..c5be4b9b8baf7330ba8a87c99332b23e534fe135 100644 (file)
@@ -149,7 +149,7 @@ static u32 dwapb_do_irq(struct dwapb_gpio *gpio)
 
 static void dwapb_irq_handler(u32 irq, struct irq_desc *desc)
 {
-       struct dwapb_gpio *gpio = irq_get_handler_data(irq);
+       struct dwapb_gpio *gpio = irq_desc_get_handler_data(desc);
        struct irq_chip *chip = irq_desc_get_chip(desc);
 
        dwapb_do_irq(gpio);
index ab660e44a672159db950be1dcf10f33f1f0989a4..b65d2b8d3b959c42e791a7ce026eac5e8156bbd8 100644 (file)
@@ -460,7 +460,7 @@ static int mvebu_gpio_irq_set_type(struct irq_data *d, unsigned int type)
 
 static void mvebu_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
 {
-       struct mvebu_gpio_chip *mvchip = irq_get_handler_data(irq);
+       struct mvebu_gpio_chip *mvchip = irq_desc_get_handler_data(desc);
        struct irq_chip *chip = irq_desc_get_chip(desc);
        u32 cause, type;
        int i;
index ec1eb1b7250ff145f5459f50b4c874154f1e23dc..0f740276ed2b565b34a08259cbb702020d149a02 100644 (file)
@@ -275,8 +275,8 @@ static void mxc_gpio_irq_handler(struct mxc_gpio_port *port, u32 irq_stat)
 static void mx3_gpio_irq_handler(u32 irq, struct irq_desc *desc)
 {
        u32 irq_stat;
-       struct mxc_gpio_port *port = irq_get_handler_data(irq);
-       struct irq_chip *chip = irq_get_chip(irq);
+       struct mxc_gpio_port *port = irq_desc_get_handler_data(desc);
+       struct irq_chip *chip = irq_desc_get_chip(desc);
 
        chained_irq_enter(chip, desc);
 
@@ -292,7 +292,7 @@ static void mx2_gpio_irq_handler(u32 irq, struct irq_desc *desc)
 {
        u32 irq_msk, irq_stat;
        struct mxc_gpio_port *port;
-       struct irq_chip *chip = irq_get_chip(irq);
+       struct irq_chip *chip = irq_desc_get_chip(desc);
 
        chained_irq_enter(chip, desc);
 
index 551d15d7c369cc12b94496a020ccdaabd494cb3c..b7f383eb18d91e2f82831e4813b987d74d18d77b 100644 (file)
@@ -157,7 +157,7 @@ static void mxs_flip_edge(struct mxs_gpio_port *port, u32 gpio)
 static void mxs_gpio_irq_handler(u32 irq, struct irq_desc *desc)
 {
        u32 irq_stat;
-       struct mxs_gpio_port *port = irq_get_handler_data(irq);
+       struct mxs_gpio_port *port = irq_desc_get_handler_data(desc);
 
        desc->irq_data.chip->irq_ack(&desc->irq_data);
 
index 1a7c2ded9d6fb24226e25a600a58b381af9a44ac..04ea23ba37ccdf192d7369e9641809a43bbd452c 100644 (file)
@@ -714,7 +714,7 @@ static void omap_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
        struct gpio_bank *bank;
        int unmasked = 0;
        struct irq_chip *irqchip = irq_desc_get_chip(desc);
-       struct gpio_chip *chip = irq_get_handler_data(irq);
+       struct gpio_chip *chip = irq_desc_get_handler_data(desc);
 
        chained_irq_enter(irqchip, desc);
 
index 271c4cf5e0cc38e5814d7ff646e5aec77801e9b6..530b27f9d66f3001a8ef64d22079e8cb6a3ab418 100644 (file)
@@ -268,16 +268,14 @@ static void tegra_gpio_irq_shutdown(struct irq_data *d)
 
 static void tegra_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
 {
-       struct tegra_gpio_bank *bank;
        int port;
        int pin;
        int unmasked = 0;
        struct irq_chip *chip = irq_desc_get_chip(desc);
+       struct tegra_gpio_bank *bank = irq_desc_get_handler_data(desc);
 
        chained_irq_enter(chip, desc);
 
-       bank = irq_get_handler_data(irq);
-
        for (port = 0; port < 4; port++) {
                int gpio = tegra_gpio_compose(bank->bank, port, 0);
                unsigned long sta = tegra_gpio_readl(GPIO_INT_STA(gpio)) &
index fd1970ed15e61be4c5a3617c5d118929411e2376..ac53ff0a8086623510efea61258711773fcc55d6 100644 (file)
@@ -194,11 +194,12 @@ out:
 
 static void timbgpio_irq(unsigned int irq, struct irq_desc *desc)
 {
-       struct timbgpio *tgpio = irq_get_handler_data(irq);
+       struct timbgpio *tgpio = irq_desc_get_handler_data(desc);
+       struct irq_data *data = irq_desc_get_irq_data(desc);
        unsigned long ipr;
        int offset;
 
-       desc->irq_data.chip->irq_ack(irq_get_irq_data(irq));
+       data->chip->irq_ack(data);
        ipr = ioread32(tgpio->membase + TGPIO_IPR);
        iowrite32(ipr, tgpio->membase + TGPIO_ICR);
 
index 7bd9f209ffa81a1b00141d4345f4fe3becc7f317..fa344388f4daa5ff2830007ff5a8c159fa1eaaa7 100644 (file)
@@ -120,7 +120,7 @@ static int vf610_gpio_direction_output(struct gpio_chip *chip, unsigned gpio,
 
 static void vf610_gpio_irq_handler(u32 irq, struct irq_desc *desc)
 {
-       struct vf610_gpio_port *port = irq_get_handler_data(irq);
+       struct vf610_gpio_port *port = irq_desc_get_handler_data(desc);
        struct irq_chip *chip = irq_desc_get_chip(desc);
        int pin;
        unsigned long irq_isfr;
index 53b297473724a5a13178ae799f0451a44901abf0..db8a61b8ca0c38caf4492fe266af6c9e2f030b2f 100644 (file)
@@ -518,7 +518,7 @@ static void zynq_gpio_irqhandler(unsigned int irq, struct irq_desc *desc)
 {
        u32 int_sts, int_enb;
        unsigned int bank_num;
-       struct zynq_gpio *gpio = irq_get_handler_data(irq);
+       struct zynq_gpio *gpio = irq_desc_get_handler_data(desc);
        struct irq_chip *irqchip = irq_desc_get_chip(desc);
 
        chained_irq_enter(irqchip, desc);