Skip to content

Commit 9745079

Browse files
committed
gpio: stmpe: Use irqchip template
This makes the driver use the irqchip template to assign properties to the gpio_irq_chip instead of using the explicit calls to gpiochip_irqchip_add_nested() and gpiochip_set_nested_irqchip(). The irqchip is instead added while adding the gpiochip. Signed-off-by: Linus Walleij <[email protected]> Cc: Patrice Chotard <[email protected]> Cc: Alexandre TORGUE <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 0fcfd9a commit 9745079

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

drivers/gpio/gpio-stmpe.c

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -507,27 +507,25 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
507507
}
508508

509509
if (irq > 0) {
510+
struct gpio_irq_chip *girq;
511+
510512
ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
511513
stmpe_gpio_irq, IRQF_ONESHOT,
512514
"stmpe-gpio", stmpe_gpio);
513515
if (ret) {
514516
dev_err(&pdev->dev, "unable to get irq: %d\n", ret);
515517
goto out_disable;
516518
}
517-
ret = gpiochip_irqchip_add_nested(&stmpe_gpio->chip,
518-
&stmpe_gpio_irq_chip,
519-
0,
520-
handle_simple_irq,
521-
IRQ_TYPE_NONE);
522-
if (ret) {
523-
dev_err(&pdev->dev,
524-
"could not connect irqchip to gpiochip\n");
525-
goto out_disable;
526-
}
527519

528-
gpiochip_set_nested_irqchip(&stmpe_gpio->chip,
529-
&stmpe_gpio_irq_chip,
530-
irq);
520+
girq = &stmpe_gpio->chip.irq;
521+
girq->chip = &stmpe_gpio_irq_chip;
522+
/* This will let us handle the parent IRQ in the driver */
523+
girq->parent_handler = NULL;
524+
girq->num_parents = 0;
525+
girq->parents = NULL;
526+
girq->default_type = IRQ_TYPE_NONE;
527+
girq->handler = handle_simple_irq;
528+
girq->threaded = true;
531529
}
532530

533531
platform_set_drvdata(pdev, stmpe_gpio);

0 commit comments

Comments
 (0)