Skip to content

Commit b470cef

Browse files
committed
gpio: rcar: Use irqchip template
This makes the driver use the irqchip template to assign properties to the gpio_irq_chip instead of using the explicit call to gpiochip_irqchip_add(). The irqchip is instead added while adding the gpiochip. Signed-off-by: Linus Walleij <[email protected]> Cc: Biju Das <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent a070bdb commit b470cef

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

drivers/gpio/gpio-rcar.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ static int gpio_rcar_probe(struct platform_device *pdev)
438438
struct resource *irq;
439439
struct gpio_chip *gpio_chip;
440440
struct irq_chip *irq_chip;
441+
struct gpio_irq_chip *girq;
441442
struct device *dev = &pdev->dev;
442443
const char *name = dev_name(dev);
443444
unsigned int npins;
@@ -496,19 +497,21 @@ static int gpio_rcar_probe(struct platform_device *pdev)
496497
irq_chip->irq_set_wake = gpio_rcar_irq_set_wake;
497498
irq_chip->flags = IRQCHIP_SET_TYPE_MASKED | IRQCHIP_MASK_ON_SUSPEND;
498499

500+
girq = &gpio_chip->irq;
501+
girq->chip = irq_chip;
502+
/* This will let us handle the parent IRQ in the driver */
503+
girq->parent_handler = NULL;
504+
girq->num_parents = 0;
505+
girq->parents = NULL;
506+
girq->default_type = IRQ_TYPE_NONE;
507+
girq->handler = handle_level_irq;
508+
499509
ret = gpiochip_add_data(gpio_chip, p);
500510
if (ret) {
501511
dev_err(dev, "failed to add GPIO controller\n");
502512
goto err0;
503513
}
504514

505-
ret = gpiochip_irqchip_add(gpio_chip, irq_chip, 0, handle_level_irq,
506-
IRQ_TYPE_NONE);
507-
if (ret) {
508-
dev_err(dev, "cannot add irqchip\n");
509-
goto err1;
510-
}
511-
512515
p->irq_parent = irq->start;
513516
if (devm_request_irq(dev, irq->start, gpio_rcar_irq_handler,
514517
IRQF_SHARED, name, p)) {

0 commit comments

Comments
 (0)