Skip to content

Commit 0fcfd9a

Browse files
committed
gpio: tc35892: 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]> Link: https://lore.kernel.org/r/[email protected]
1 parent 80606cb commit 0fcfd9a

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

drivers/gpio/gpio-tc3589x.c

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ static int tc3589x_gpio_probe(struct platform_device *pdev)
289289
struct tc3589x *tc3589x = dev_get_drvdata(pdev->dev.parent);
290290
struct device_node *np = pdev->dev.of_node;
291291
struct tc3589x_gpio *tc3589x_gpio;
292+
struct gpio_irq_chip *girq;
292293
int ret;
293294
int irq;
294295

@@ -317,6 +318,16 @@ static int tc3589x_gpio_probe(struct platform_device *pdev)
317318
tc3589x_gpio->chip.base = -1;
318319
tc3589x_gpio->chip.of_node = np;
319320

321+
girq = &tc3589x_gpio->chip.irq;
322+
girq->chip = &tc3589x_gpio_irq_chip;
323+
/* This will let us handle the parent IRQ in the driver */
324+
girq->parent_handler = NULL;
325+
girq->num_parents = 0;
326+
girq->parents = NULL;
327+
girq->default_type = IRQ_TYPE_NONE;
328+
girq->handler = handle_simple_irq;
329+
girq->threaded = true;
330+
320331
/* Bring the GPIO module out of reset */
321332
ret = tc3589x_set_bits(tc3589x, TC3589x_RSTCTRL,
322333
TC3589x_RSTCTRL_GPIRST, 0);
@@ -339,21 +350,6 @@ static int tc3589x_gpio_probe(struct platform_device *pdev)
339350
return ret;
340351
}
341352

342-
ret = gpiochip_irqchip_add_nested(&tc3589x_gpio->chip,
343-
&tc3589x_gpio_irq_chip,
344-
0,
345-
handle_simple_irq,
346-
IRQ_TYPE_NONE);
347-
if (ret) {
348-
dev_err(&pdev->dev,
349-
"could not connect irqchip to gpiochip\n");
350-
return ret;
351-
}
352-
353-
gpiochip_set_nested_irqchip(&tc3589x_gpio->chip,
354-
&tc3589x_gpio_irq_chip,
355-
irq);
356-
357353
platform_set_drvdata(pdev, tc3589x_gpio);
358354

359355
return 0;

0 commit comments

Comments
 (0)