diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2018-09-13 08:02:12 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2018-09-14 06:49:19 -0400 |
commit | e897b3866580978d5081970ccdd732c137ab08b0 (patch) | |
tree | 02c65a99c5d46fd72708739f7ca323e87158b0d8 | |
parent | 0c3dfa176912b5f87732545598200fb55e9c1978 (diff) |
pinctrl: at91-pio4: Get rid of legacy call
By just moving the atmel_gpio_to_irq() and calling the internal
function we can get rid of the driver calling back out into the
deprecated external consumer API.
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/pinctrl/pinctrl-at91-pio4.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c index 9e2f3738bf3e..5a850491a5cb 100644 --- a/drivers/pinctrl/pinctrl-at91-pio4.c +++ b/drivers/pinctrl/pinctrl-at91-pio4.c | |||
@@ -17,8 +17,6 @@ | |||
17 | #include <dt-bindings/pinctrl/at91.h> | 17 | #include <dt-bindings/pinctrl/at91.h> |
18 | #include <linux/clk.h> | 18 | #include <linux/clk.h> |
19 | #include <linux/gpio/driver.h> | 19 | #include <linux/gpio/driver.h> |
20 | /* FIXME: needed for gpio_to_irq(), get rid of this */ | ||
21 | #include <linux/gpio.h> | ||
22 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
23 | #include <linux/io.h> | 21 | #include <linux/io.h> |
24 | #include <linux/init.h> | 22 | #include <linux/init.h> |
@@ -264,6 +262,13 @@ static struct irq_chip atmel_gpio_irq_chip = { | |||
264 | .irq_set_wake = atmel_gpio_irq_set_wake, | 262 | .irq_set_wake = atmel_gpio_irq_set_wake, |
265 | }; | 263 | }; |
266 | 264 | ||
265 | static int atmel_gpio_to_irq(struct gpio_chip *chip, unsigned offset) | ||
266 | { | ||
267 | struct atmel_pioctrl *atmel_pioctrl = gpiochip_get_data(chip); | ||
268 | |||
269 | return irq_find_mapping(atmel_pioctrl->irq_domain, offset); | ||
270 | } | ||
271 | |||
267 | static void atmel_gpio_irq_handler(struct irq_desc *desc) | 272 | static void atmel_gpio_irq_handler(struct irq_desc *desc) |
268 | { | 273 | { |
269 | unsigned int irq = irq_desc_get_irq(desc); | 274 | unsigned int irq = irq_desc_get_irq(desc); |
@@ -297,8 +302,9 @@ static void atmel_gpio_irq_handler(struct irq_desc *desc) | |||
297 | break; | 302 | break; |
298 | 303 | ||
299 | for_each_set_bit(n, &isr, BITS_PER_LONG) | 304 | for_each_set_bit(n, &isr, BITS_PER_LONG) |
300 | generic_handle_irq(gpio_to_irq(bank * | 305 | generic_handle_irq(atmel_gpio_to_irq( |
301 | ATMEL_PIO_NPINS_PER_BANK + n)); | 306 | atmel_pioctrl->gpio_chip, |
307 | bank * ATMEL_PIO_NPINS_PER_BANK + n)); | ||
302 | } | 308 | } |
303 | 309 | ||
304 | chained_irq_exit(chip, desc); | 310 | chained_irq_exit(chip, desc); |
@@ -360,13 +366,6 @@ static void atmel_gpio_set(struct gpio_chip *chip, unsigned offset, int val) | |||
360 | BIT(pin->line)); | 366 | BIT(pin->line)); |
361 | } | 367 | } |
362 | 368 | ||
363 | static int atmel_gpio_to_irq(struct gpio_chip *chip, unsigned offset) | ||
364 | { | ||
365 | struct atmel_pioctrl *atmel_pioctrl = gpiochip_get_data(chip); | ||
366 | |||
367 | return irq_find_mapping(atmel_pioctrl->irq_domain, offset); | ||
368 | } | ||
369 | |||
370 | static struct gpio_chip atmel_gpio_chip = { | 369 | static struct gpio_chip atmel_gpio_chip = { |
371 | .direction_input = atmel_gpio_direction_input, | 370 | .direction_input = atmel_gpio_direction_input, |
372 | .get = atmel_gpio_get, | 371 | .get = atmel_gpio_get, |