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

gpio-bcm-kona: use new req/relres and dis/enable_irq funcs

Since this driver does not use the gpiolib irqchip helpers it will have to
allocate the irq resources and irq_en/disable itself.

Use the new gpiochip_req/relres_irq helpers to request/release all the
resources.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Ray Jui <rjui@broadcom.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Hans Verkuil and committed by
Linus Walleij
1c939cb5 4f8183ae

+4 -10
+4 -10
drivers/gpio/gpio-bcm-kona.c
··· 373 373 val = readl(reg_base + GPIO_INT_MASK(bank_id)); 374 374 val |= BIT(bit); 375 375 writel(val, reg_base + GPIO_INT_MASK(bank_id)); 376 + gpiochip_disable_irq(&kona_gpio->gpio_chip, gpio); 376 377 377 378 raw_spin_unlock_irqrestore(&kona_gpio->lock, flags); 378 379 } ··· 395 394 val = readl(reg_base + GPIO_INT_MSKCLR(bank_id)); 396 395 val |= BIT(bit); 397 396 writel(val, reg_base + GPIO_INT_MSKCLR(bank_id)); 397 + gpiochip_enable_irq(&kona_gpio->gpio_chip, gpio); 398 398 399 399 raw_spin_unlock_irqrestore(&kona_gpio->lock, flags); 400 400 } ··· 487 485 static int bcm_kona_gpio_irq_reqres(struct irq_data *d) 488 486 { 489 487 struct bcm_kona_gpio *kona_gpio = irq_data_get_irq_chip_data(d); 490 - int ret; 491 488 492 - ret = gpiochip_lock_as_irq(&kona_gpio->gpio_chip, d->hwirq); 493 - if (ret) { 494 - dev_err(kona_gpio->gpio_chip.parent, 495 - "unable to lock HW IRQ %lu for IRQ\n", 496 - d->hwirq); 497 - return ret; 498 - } 499 - return 0; 489 + return gpiochip_reqres_irq(&kona_gpio->gpio_chip, d->hwirq); 500 490 } 501 491 502 492 static void bcm_kona_gpio_irq_relres(struct irq_data *d) 503 493 { 504 494 struct bcm_kona_gpio *kona_gpio = irq_data_get_irq_chip_data(d); 505 495 506 - gpiochip_unlock_as_irq(&kona_gpio->gpio_chip, d->hwirq); 496 + gpiochip_relres_irq(&kona_gpio->gpio_chip, d->hwirq); 507 497 } 508 498 509 499 static struct irq_chip bcm_gpio_irq_chip = {