Skip to content

Commit

Permalink
gpio: sta2x11: use devres for irq generic chip
Browse files Browse the repository at this point in the history
Use resource managed variants of irq_alloc_generic_chip() and
irq_setup_generic_chip().

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Bartosz Golaszewski authored and Linus Walleij committed Aug 20, 2017
1 parent a6f5f1b commit 624b5a9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions drivers/gpio/gpio-sta2x11.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,11 @@ static int gsta_alloc_irq_chip(struct gsta_gpio *chip)
{
struct irq_chip_generic *gc;
struct irq_chip_type *ct;
int rv;

gc = irq_alloc_generic_chip(KBUILD_MODNAME, 1, chip->irq_base,
chip->reg_base, handle_simple_irq);
gc = devm_irq_alloc_generic_chip(chip->dev, KBUILD_MODNAME, 1,
chip->irq_base,
chip->reg_base, handle_simple_irq);
if (!gc)
return -ENOMEM;

Expand All @@ -338,8 +340,11 @@ static int gsta_alloc_irq_chip(struct gsta_gpio *chip)
ct->chip.irq_enable = gsta_irq_enable;

/* FIXME: this makes at most 32 interrupts. Request 0 by now */
irq_setup_generic_chip(gc, 0 /* IRQ_MSK(GSTA_GPIO_PER_BLOCK) */, 0,
IRQ_NOREQUEST | IRQ_NOPROBE, 0);
rv = devm_irq_setup_generic_chip(chip->dev, gc,
0 /* IRQ_MSK(GSTA_GPIO_PER_BLOCK) */,
0, IRQ_NOREQUEST | IRQ_NOPROBE, 0);
if (rv)
return rv;

/* Set up all all 128 interrupts: code from setup_generic_chip */
{
Expand Down

0 comments on commit 624b5a9

Please sign in to comment.