The Linux Kernel Mailing List
 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 6/6] gpio: sodaville: use devres for irq generic chip
Date: Wed,  2 Aug 2017 09:51:26 +0200	[thread overview]
Message-ID: <20170802075126.17637-7-brgl@bgdev.pl> (raw)
In-Reply-To: <20170802075126.17637-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-sodaville.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/gpio/gpio-sodaville.c b/drivers/gpio/gpio-sodaville.c
index f60da83349ef..20a39f5ac361 100644
--- a/drivers/gpio/gpio-sodaville.c
+++ b/drivers/gpio/gpio-sodaville.c
@@ -155,8 +155,9 @@ static int sdv_register_irqsupport(struct sdv_gpio_chip_data *sd,
 	 * we unmask & ACK the IRQ before the source of the interrupt is gone
 	 * then the interrupt is active again.
 	 */
-	sd->gc = irq_alloc_generic_chip("sdv-gpio", 1, sd->irq_base,
-			sd->gpio_pub_base, handle_fasteoi_irq);
+	sd->gc = devm_irq_alloc_generic_chip(&pdev->dev, "sdv-gpio", 1,
+					     sd->irq_base, sd->gpio_pub_base,
+					     handle_fasteoi_irq);
 	if (!sd->gc)
 		return -ENOMEM;
 
@@ -170,9 +171,13 @@ static int sdv_register_irqsupport(struct sdv_gpio_chip_data *sd,
 	ct->chip.irq_eoi = irq_gc_eoi;
 	ct->chip.irq_set_type = sdv_gpio_pub_set_type;
 
-	irq_setup_generic_chip(sd->gc, IRQ_MSK(SDV_NUM_PUB_GPIOS),
-			IRQ_GC_INIT_MASK_CACHE, IRQ_NOREQUEST,
-			IRQ_LEVEL | IRQ_NOPROBE);
+	ret = devm_irq_setup_generic_chip(&pdev->dev, sd->gc,
+					  IRQ_MSK(SDV_NUM_PUB_GPIOS),
+					  IRQ_GC_INIT_MASK_CACHE,
+					  IRQ_NOREQUEST,
+					  IRQ_LEVEL | IRQ_NOPROBE);
+	if (ret)
+		return ret;
 
 	sd->id = irq_domain_add_legacy(pdev->dev.of_node, SDV_NUM_PUB_GPIOS,
 				sd->irq_base, 0, &irq_domain_sdv_ops, sd);
-- 
2.13.2

  parent reply	other threads:[~2017-08-02  7:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-02  7:51 [PATCH 0/6] gpio: use devres for irq generic chip Bartosz Golaszewski
2017-08-02  7:51 ` [PATCH 1/6] gpio: sta2x11: " Bartosz Golaszewski
2017-08-02 11:38   ` Linus Walleij
2017-08-02  7:51 ` [PATCH 2/6] gpio: ml-ioh: " Bartosz Golaszewski
2017-08-02 11:39   ` Linus Walleij
2017-08-02  7:51 ` [PATCH 3/6] gpio: pch: " Bartosz Golaszewski
2017-08-02 11:39   ` Linus Walleij
2017-08-02  7:51 ` [PATCH 4/6] gpio: mxc: " Bartosz Golaszewski
2017-08-02  8:09   ` Alexander Stein
2017-08-02  8:26     ` Bartosz Golaszewski
2017-08-02  8:32     ` Andy Shevchenko
2017-08-02 11:41       ` Linus Walleij
2017-08-02 11:54         ` Bartosz Golaszewski
2017-08-02  7:51 ` [PATCH 5/6] gpio: mxs: " Bartosz Golaszewski
2017-08-02  7:51 ` Bartosz Golaszewski [this message]
2017-08-20 21:56 ` [PATCH 0/6] 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=20170802075126.17637-7-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