gpio: mxc: 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>
This commit is contained in:
parent
74dd9ebfff
commit
c553c3c478
@ -471,7 +471,7 @@ static int mxc_gpio_probe(struct platform_device *pdev)
|
|||||||
if (err)
|
if (err)
|
||||||
goto out_bgio;
|
goto out_bgio;
|
||||||
|
|
||||||
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) {
|
if (irq_base < 0) {
|
||||||
err = irq_base;
|
err = irq_base;
|
||||||
goto out_bgio;
|
goto out_bgio;
|
||||||
@ -481,7 +481,7 @@ static int mxc_gpio_probe(struct platform_device *pdev)
|
|||||||
&irq_domain_simple_ops, NULL);
|
&irq_domain_simple_ops, NULL);
|
||||||
if (!port->domain) {
|
if (!port->domain) {
|
||||||
err = -ENODEV;
|
err = -ENODEV;
|
||||||
goto out_irqdesc_free;
|
goto out_bgio;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* gpio-mxc can be a generic irq chip */
|
/* gpio-mxc can be a generic irq chip */
|
||||||
@ -495,8 +495,6 @@ static int mxc_gpio_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
out_irqdomain_remove:
|
out_irqdomain_remove:
|
||||||
irq_domain_remove(port->domain);
|
irq_domain_remove(port->domain);
|
||||||
out_irqdesc_free:
|
|
||||||
irq_free_descs(irq_base, 32);
|
|
||||||
out_bgio:
|
out_bgio:
|
||||||
dev_info(&pdev->dev, "%s failed with errno %d\n", __func__, err);
|
dev_info(&pdev->dev, "%s failed with errno %d\n", __func__, err);
|
||||||
return err;
|
return err;
|
||||||
|
Loading…
Reference in New Issue
Block a user