From patchwork Sat Mar 4 16:23:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 9604107 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B98CE602B4 for ; Sat, 4 Mar 2017 16:31:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACF6F28460 for ; Sat, 4 Mar 2017 16:31:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9FDE1284E7; Sat, 4 Mar 2017 16:31:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5783128460 for ; Sat, 4 Mar 2017 16:31:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752285AbdCDQak (ORCPT ); Sat, 4 Mar 2017 11:30:40 -0500 Received: from mail-wr0-f170.google.com ([209.85.128.170]:35373 "EHLO mail-wr0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752108AbdCDQaj (ORCPT ); Sat, 4 Mar 2017 11:30:39 -0500 Received: by mail-wr0-f170.google.com with SMTP id g10so91282595wrg.2 for ; Sat, 04 Mar 2017 08:30:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5lFvIHCr/ME9NL1kcCphrW3u+r2HMmlHvn0VedJtpNk=; b=VQmA75rKSfT6FYJjYOFyI2EAmGJJDKLrivCawz42rH400PNoQtDwBwQkBF1AZAJb6x njDNTwsiAHGSc+NLxBUQhgDhNSx+lOQ5nfTokg9AguxmQhWkmlcMVFUSc/BpBUPZrOT9 0yUg2B8C4q2hWca33QLTZWhRuErO7PrXnhCI29jksLDpwaJTOFsCIr7dhvNTNvzjqlj2 jZOsvK5NJTj1lUkhtLTnErr4HhQhZ7DBWQ9uL8p5+HMzuzL2telis45qFFFh6EOwv8LT vDZY3pAolR/DDTyJ5+9l+CIZpYAWtKwbYgBQ+NXpq+RsRtLJs2D8vmozSQpZwxias/DO fbWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5lFvIHCr/ME9NL1kcCphrW3u+r2HMmlHvn0VedJtpNk=; b=XdQT5QKSIloB3YCy1ym3xhXmArLQdQmKAZErS09NnODiIWycgkMoiJsUz4y9iYR+qJ go5MoPZBMwFebeRUKp7OVgUmM74PZVewzhLyNCZHDVIbgolkbRWOXeFWpARu7RCVOujc 84FSjDSOvWu6T2FcD/OlUckBbUpf5VJGoWZZN9qKLBI0BH4fmUuBi0lJ985bZB7FYUGR IgWUEHU/veZFVon7tYFyT2M4sVWGq/94l8HJZx6ydUd2/ZoaKUZ+NgPY59yJ5mYfJXwm XxXAVvLXuizb2Ohadh1qQDM6U2ngwSY2VzwqIM7sgxOBwe0HpKka5SXnU3SpVooCXvFr /pww== X-Gm-Message-State: AMke39kP1w6NiVN6gm3yO5m4NFw6Harq7OTF2c1n8hJWe65tn1SY6OUWbNDo+Drz0/+7DxUW X-Received: by 10.223.155.129 with SMTP id d1mr341167wrc.67.1488644644333; Sat, 04 Mar 2017 08:24:04 -0800 (PST) Received: from bgdev-debian.lan (jua06-1-82-242-157-225.fbx.proxad.net. [82.242.157.225]) by smtp.gmail.com with ESMTPSA id b17sm7545753wma.33.2017.03.04.08.24.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 04 Mar 2017 08:24:03 -0800 (PST) From: Bartosz Golaszewski To: Linus Walleij , Alexandre Courbot , Bamvor Jian Zhang , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Robert Jarzmik Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, Thomas Gleixner , Marc Zyngier , Bartosz Golaszewski Subject: [PATCH 03/12] gpio: omap: use devm_irq_alloc_descs() Date: Sat, 4 Mar 2017 17:23:31 +0100 Message-Id: <1488644620-11488-4-git-send-email-bgolaszewski@baylibre.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1488644620-11488-1-git-send-email-bgolaszewski@baylibre.com> References: <1488644620-11488-1-git-send-email-bgolaszewski@baylibre.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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;