From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
To: Linus Walleij <linus.walleij@linaro.org>,
Alexandre Courbot <gnurou@gmail.com>,
Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>,
Grygorii Strashko <grygorii.strashko@ti.com>,
Santosh Shilimkar <ssantosh@kernel.org>,
Kevin Hilman <khilman@kernel.org>,
Robert Jarzmik <robert.jarzmik@free.fr>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-omap@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>,
Marc Zyngier <marc.zyngier@arm.com>,
Bartosz Golaszewski <bgolaszewski@baylibre.com>
Subject: [PATCH 11/12] gpio: mxs: use devm_irq_alloc_descs()
Date: Sat, 4 Mar 2017 17:23:39 +0100 [thread overview]
Message-ID: <1488644620-11488-12-git-send-email-bgolaszewski@baylibre.com> (raw)
In-Reply-To: <1488644620-11488-1-git-send-email-bgolaszewski@baylibre.com>
This driver never frees the interrupt descriptors it allocates. Fix
it by using the resource managed version of irq_alloc_descs().
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
drivers/gpio/gpio-mxs.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-mxs.c b/drivers/gpio/gpio-mxs.c
index 2292742..6ae583f 100644
--- a/drivers/gpio/gpio-mxs.c
+++ b/drivers/gpio/gpio-mxs.c
@@ -328,7 +328,7 @@ static int mxs_gpio_probe(struct platform_device *pdev)
/* clear address has to be used to clear IRQSTAT bits */
writel(~0U, port->base + PINCTRL_IRQSTAT(port) + MXS_CLR);
- irq_base = irq_alloc_descs(-1, 0, 32, numa_node_id());
+ irq_base = devm_irq_alloc_descs(&pdev->dev, -1, 0, 32, numa_node_id());
if (irq_base < 0) {
err = irq_base;
goto out_iounmap;
@@ -338,7 +338,7 @@ static int mxs_gpio_probe(struct platform_device *pdev)
&irq_domain_simple_ops, NULL);
if (!port->domain) {
err = -ENODEV;
- goto out_irqdesc_free;
+ goto out_iounmap;
}
/* gpio-mxs can be a generic irq chip */
@@ -370,8 +370,6 @@ static int mxs_gpio_probe(struct platform_device *pdev)
out_irqdomain_remove:
irq_domain_remove(port->domain);
-out_irqdesc_free:
- irq_free_descs(irq_base, 32);
out_iounmap:
iounmap(port->base);
return err;
--
2.9.3
next prev parent reply other threads:[~2017-03-04 16:23 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-04 16:23 [PATCH 00/12] gpio: use resource management for irq descriptors Bartosz Golaszewski
2017-03-04 16:23 ` [PATCH 01/12] gpio: mockup: use devm_irq_alloc_descs() Bartosz Golaszewski
2017-03-08 8:21 ` Bamvor Zhang Jian
2017-03-14 15:08 ` Linus Walleij
2017-03-04 16:23 ` [PATCH 02/12] gpio: twl4030: " Bartosz Golaszewski
2017-03-14 15:08 ` Linus Walleij
2017-03-04 16:23 ` [PATCH 03/12] gpio: omap: " Bartosz Golaszewski
2017-03-06 16:50 ` Tony Lindgren
2017-03-14 15:09 ` Linus Walleij
2017-03-04 16:23 ` [PATCH 04/12] gpio: pch: use resource management for irqs Bartosz Golaszewski
2017-03-14 15:10 ` Linus Walleij
2017-03-04 16:23 ` [PATCH 05/12] gpio: ml-ioh: " Bartosz Golaszewski
2017-03-14 15:11 ` Linus Walleij
2017-03-04 16:23 ` [PATCH 06/12] gpio: xlp: " Bartosz Golaszewski
2017-03-14 15:11 ` Linus Walleij
2017-03-04 16:23 ` [PATCH 07/12] gpio: pxa: use devm_irq_alloc_descs() Bartosz Golaszewski
2017-03-04 20:31 ` Robert Jarzmik
2017-03-14 15:12 ` Linus Walleij
2017-03-04 16:23 ` [PATCH 08/12] gpio: davinci: " Bartosz Golaszewski
2017-03-06 4:59 ` Keerthy
2017-03-14 15:13 ` Linus Walleij
2017-03-04 16:23 ` [PATCH 09/12] gpio: sodaville: use resource management for irqs Bartosz Golaszewski
2017-03-14 15:14 ` Linus Walleij
2017-03-04 16:23 ` [PATCH 10/12] gpio: mxc: use devm_irq_alloc_descs() Bartosz Golaszewski
2017-03-14 15:15 ` Linus Walleij
2017-03-04 16:23 ` Bartosz Golaszewski [this message]
2017-03-14 15:16 ` [PATCH 11/12] gpio: mxs: " Linus Walleij
2017-03-04 16:23 ` [PATCH 12/12] gpio: sta2x11: use resource management for irqs Bartosz Golaszewski
2017-03-14 15:16 ` Linus Walleij
2017-03-14 15:18 ` [PATCH 00/12] gpio: use resource management for irq descriptors Linus Walleij
2017-03-14 15:45 ` Bartosz Golaszewski
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=1488644620-11488-12-git-send-email-bgolaszewski@baylibre.com \
--to=bgolaszewski@baylibre.com \
--cc=bamvor.zhangjian@linaro.org \
--cc=gnurou@gmail.com \
--cc=grygorii.strashko@ti.com \
--cc=khilman@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=robert.jarzmik@free.fr \
--cc=ssantosh@kernel.org \
--cc=tglx@linutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).