Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+10 -11
+10 -11
drivers/pinctrl/pinctrl-at91-pio4.c
··· 17 17 #include <dt-bindings/pinctrl/at91.h> 18 18 #include <linux/clk.h> 19 19 #include <linux/gpio/driver.h> 20 - /* FIXME: needed for gpio_to_irq(), get rid of this */ 21 - #include <linux/gpio.h> 22 20 #include <linux/interrupt.h> 23 21 #include <linux/io.h> 24 22 #include <linux/init.h> ··· 262 264 .irq_set_wake = atmel_gpio_irq_set_wake, 263 265 }; 264 266 267 + static int atmel_gpio_to_irq(struct gpio_chip *chip, unsigned offset) 268 + { 269 + struct atmel_pioctrl *atmel_pioctrl = gpiochip_get_data(chip); 270 + 271 + return irq_find_mapping(atmel_pioctrl->irq_domain, offset); 272 + } 273 + 265 274 static void atmel_gpio_irq_handler(struct irq_desc *desc) 266 275 { 267 276 unsigned int irq = irq_desc_get_irq(desc); ··· 302 297 break; 303 298 304 299 for_each_set_bit(n, &isr, BITS_PER_LONG) 305 - generic_handle_irq(gpio_to_irq(bank * 306 - ATMEL_PIO_NPINS_PER_BANK + n)); 300 + generic_handle_irq(atmel_gpio_to_irq( 301 + atmel_pioctrl->gpio_chip, 302 + bank * ATMEL_PIO_NPINS_PER_BANK + n)); 307 303 } 308 304 309 305 chained_irq_exit(chip, desc); ··· 364 358 atmel_gpio_write(atmel_pioctrl, pin->bank, 365 359 val ? ATMEL_PIO_SODR : ATMEL_PIO_CODR, 366 360 BIT(pin->line)); 367 - } 368 - 369 - static int atmel_gpio_to_irq(struct gpio_chip *chip, unsigned offset) 370 - { 371 - struct atmel_pioctrl *atmel_pioctrl = gpiochip_get_data(chip); 372 - 373 - return irq_find_mapping(atmel_pioctrl->irq_domain, offset); 374 361 } 375 362 376 363 static struct gpio_chip atmel_gpio_chip = {