mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Bartosz Golaszewski <brgl@bgdev.pl>
Subject: [PATCH v2 4/8] gpio: sta2x11: use devres for irq generic chip
Date: Wed,  9 Aug 2017 14:25:03 +0200	[thread overview]
Message-ID: <20170809122507.11149-5-brgl@bgdev.pl> (raw)
In-Reply-To: <20170809122507.11149-1-brgl@bgdev.pl>

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 56beb31c03db..407359da08f9 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

  parent reply	other threads:[~2017-08-09 12:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-09 12:24 [PATCH v2 0/8] gpio: " Bartosz Golaszewski
2017-08-09 12:25 ` [PATCH v2 1/8] gpio: mxc: disallow unbinding the driver Bartosz Golaszewski
2017-08-09 12:25 ` [PATCH v2 2/8] gpio: mxs: " Bartosz Golaszewski
2017-08-09 12:25 ` [PATCH v2 3/8] gpio: sta2x11: " Bartosz Golaszewski
2017-08-09 12:25 ` Bartosz Golaszewski [this message]
2017-08-09 12:25 ` [PATCH v2 5/8] gpio: ml-ioh: use devres for irq generic chip Bartosz Golaszewski
2017-08-09 12:25 ` [PATCH v2 6/8] gpio: pch: " Bartosz Golaszewski
2017-08-09 12:25 ` [PATCH v2 7/8] gpio: mxc: " Bartosz Golaszewski
2017-08-09 12:25 ` [PATCH v2 8/8] gpio: mxs: " Bartosz Golaszewski
2017-08-20 22:03 ` [PATCH v2 0/8] gpio: " Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170809122507.11149-5-brgl@bgdev.pl \
    --to=brgl@bgdev.pl \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome