diff mbox

[03/12] gpio: omap: use devm_irq_alloc_descs()

Message ID 1488644620-11488-4-git-send-email-bgolaszewski@baylibre.com (mailing list archive)
State New, archived
Headers show

Commit Message

Bartosz Golaszewski March 4, 2017, 4:23 p.m. UTC
This driver never frees the allocated interrupt descriptors. Fix it by
using a resource managed variant of irq_alloc_descs().

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/gpio/gpio-omap.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Tony Lindgren March 6, 2017, 4:50 p.m. UTC | #1
* Bartosz Golaszewski <bgolaszewski@baylibre.com> [170304 08:33]:
> This driver never frees the allocated interrupt descriptors. Fix it by
> using a resource managed variant of irq_alloc_descs().
> 
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Would be good to get Aaro's ack on this one.

Regards,

Tony

> ---
>  drivers/gpio/gpio-omap.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
> index efc85a2..5d6a574 100644
> --- a/drivers/gpio/gpio-omap.c
> +++ b/drivers/gpio/gpio-omap.c
> @@ -1085,7 +1085,8 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)
>  	 * REVISIT: Once we have OMAP1 supporting SPARSE_IRQ, we can drop
>  	 * irq_alloc_descs() since a base IRQ offset will no longer be needed.
>  	 */
> -	irq_base = irq_alloc_descs(-1, 0, bank->width, 0);
> +	irq_base = devm_irq_alloc_descs(bank->chip.parent,
> +					-1, 0, bank->width, 0);
>  	if (irq_base < 0) {
>  		dev_err(bank->chip.parent, "Couldn't allocate IRQ numbers\n");
>  		return -ENODEV;
> -- 
> 2.9.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Linus Walleij March 14, 2017, 3:09 p.m. UTC | #2
On Sat, Mar 4, 2017 at 5:23 PM, Bartosz Golaszewski
<bgolaszewski@baylibre.com> wrote:

> This driver never frees the allocated interrupt descriptors. Fix it by
> using a resource managed variant of irq_alloc_descs().
>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Patch applied.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index efc85a2..5d6a574 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1085,7 +1085,8 @@  static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)
 	 * REVISIT: Once we have OMAP1 supporting SPARSE_IRQ, we can drop
 	 * irq_alloc_descs() since a base IRQ offset will no longer be needed.
 	 */
-	irq_base = irq_alloc_descs(-1, 0, bank->width, 0);
+	irq_base = devm_irq_alloc_descs(bank->chip.parent,
+					-1, 0, bank->width, 0);
 	if (irq_base < 0) {
 		dev_err(bank->chip.parent, "Couldn't allocate IRQ numbers\n");
 		return -ENODEV;