Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1701810

[PATCH 1/6] gpio: sta2x11: use devres for irq generic chip

From Bartosz Golaszewski <brgl@bgdev.pl>
Newsgroups linux.kernel
Subject [PATCH 1/6] gpio: sta2x11: use devres for irq generic chip
Date 2017-08-02 10:00 +0200
Message-ID <u9WJs-70R-17@gated-at.bofh.it> (permalink)
References <u9WJr-70R-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Use resource managed variants of irq_alloc_generic_chip() and
irq_setup_generic_chip().

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
---
 drivers/gpio/gpio-sta2x11.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/gpio/gpio-sta2x11.c b/drivers/gpio/gpio-sta2x11.c
index 9e705162da8d..a16c1c4f92a7 100644
--- a/drivers/gpio/gpio-sta2x11.c
+++ b/drivers/gpio/gpio-sta2x11.c
@@ -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;
 
@@ -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 */
 	{
-- 
2.13.2

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/6] gpio: use devres for irq generic chip Bartosz Golaszewski <brgl@bgdev.pl> - 2017-08-02 10:00 +0200
  [PATCH 1/6] gpio: sta2x11: use devres for irq generic chip Bartosz Golaszewski <brgl@bgdev.pl> - 2017-08-02 10:00 +0200
    Re: [PATCH 1/6] gpio: sta2x11: use devres for irq generic chip Linus Walleij <linus.walleij@linaro.org> - 2017-08-02 13:40 +0200
  [PATCH 5/6] gpio: mxs: use devres for irq generic chip Bartosz Golaszewski <brgl@bgdev.pl> - 2017-08-02 10:00 +0200
  [PATCH 4/6] gpio: mxc: use devres for irq generic chip Bartosz Golaszewski <brgl@bgdev.pl> - 2017-08-02 10:00 +0200
    Re: [PATCH 4/6] gpio: mxc: use devres for irq generic chip Bartosz Golaszewski <brgl@bgdev.pl> - 2017-08-02 10:30 +0200
    Re: [PATCH 4/6] gpio: mxc: use devres for irq generic chip Alexander Stein <alexander.stein@systec-electronic.com> - 2017-08-02 10:30 +0200
      Re: [PATCH 4/6] gpio: mxc: use devres for irq generic chip Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-08-02 10:40 +0200
        Re: [PATCH 4/6] gpio: mxc: use devres for irq generic chip Linus Walleij <linus.walleij@linaro.org> - 2017-08-02 13:50 +0200
          Re: [PATCH 4/6] gpio: mxc: use devres for irq generic chip Bartosz Golaszewski <brgl@bgdev.pl> - 2017-08-02 14:00 +0200
  [PATCH 3/6] gpio: pch: use devres for irq generic chip Bartosz Golaszewski <brgl@bgdev.pl> - 2017-08-02 10:00 +0200
    Re: [PATCH 3/6] gpio: pch: use devres for irq generic chip Linus Walleij <linus.walleij@linaro.org> - 2017-08-02 13:40 +0200
  [PATCH 6/6] gpio: sodaville: use devres for irq generic chip Bartosz Golaszewski <brgl@bgdev.pl> - 2017-08-02 10:00 +0200
  [PATCH 2/6] gpio: ml-ioh: use devres for irq generic chip Bartosz Golaszewski <brgl@bgdev.pl> - 2017-08-02 10:00 +0200
    Re: [PATCH 2/6] gpio: ml-ioh: use devres for irq generic chip Linus Walleij <linus.walleij@linaro.org> - 2017-08-02 13:40 +0200

csiph-web