summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-mxs.c
diff options
context:
space:
mode:
authorBartosz Golaszewski <bgolaszewski@baylibre.com>2017-03-04 17:23:39 +0100
committerLinus Walleij <linus.walleij@linaro.org>2017-03-15 11:16:37 +0100
commit8514b5439c90f077fadaf981b5f1aec9cde7be76 (patch)
tree50bc9d7023986515386f46da8bea1f6c1bec6194 /drivers/gpio/gpio-mxs.c
parentc553c3c4786b9bfbf46b90ebac9c28192377fc13 (diff)
gpio: mxs: use devm_irq_alloc_descs()
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> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-mxs.c')
-rw-r--r--drivers/gpio/gpio-mxs.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/gpio/gpio-mxs.c b/drivers/gpio/gpio-mxs.c
index 2292742eac8f..6ae583f36733 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;