From patchwork Sat Mar 4 16:23:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 9604127 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 0FF06602B4 for ; Sat, 4 Mar 2017 16:32:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0264528509 for ; Sat, 4 Mar 2017 16:32:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EAC5928510; Sat, 4 Mar 2017 16:32:50 +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 9AB7A28509 for ; Sat, 4 Mar 2017 16:32:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752336AbdCDQct (ORCPT ); Sat, 4 Mar 2017 11:32:49 -0500 Received: from mail-wr0-f170.google.com ([209.85.128.170]:36587 "EHLO mail-wr0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752425AbdCDQcG (ORCPT ); Sat, 4 Mar 2017 11:32:06 -0500 Received: by mail-wr0-f170.google.com with SMTP id u108so91319819wrb.3 for ; Sat, 04 Mar 2017 08:31:55 -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=1sfLR9QMFywM3VnSQagXMXczxbZIqgboekZG9h1WqxI=; b=ucFrH6T0ERtorBlfcwEvJF59nB9hGnlIvsXT9Oc7NVImH8AVfbvaIvkm/QY5qqMk1d ZXMeFZ66gn+EHeZw+sh9KXGs0Gd947ujkhuSRo2uH/CwADGSuV4BlssS2txA2wJwwXhA WdG0JL0BDJJQOYhlwENh6DUoUiGwWPskKkxXQxOv8mCy4AUzcx8mX1ELdthtkCePTArH 1MasfU0pQICsWzkj3rLPzRb/AixLrkmQzZ2FDFH3JOWzaYvhjgklDe5ouYhPWhmGL0KL 77KsZemLL2uPcCcRLFQ3KBQFHT8h1F+xo3YtXo6tuc9nR3DcJ1h6y3ZR/XOn51FgKxOe Y/7g== 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=1sfLR9QMFywM3VnSQagXMXczxbZIqgboekZG9h1WqxI=; b=Fe8Y+xSxm91vj3PK6eReceit5TEhBYLa2FSsG9yRzFJ8TEVcYEBLseQjYZlV827MkA Zk31i1DA+LKr8uUAqggvaW/OvxaqYNAQEAVwpyRBv3XC0iq4o6cjXkn8Mdvbnc4/rSTN YDb8Whc82s3thqY+xvZRPCkxHv8i6Mcao1yV+RdncNKRLlyeOX3bzVIubD2y6qx0WDOj PwiZaEY709O7NE0gEYpGX3FMArYPjtL7Xnp6UmN2mJp2+5fL0bUXK4+uzKfw9V3+RKvF dW5G+Lk4lLtTYw0cPfD8lv1+s6OADU9gOTOs0gGIhwX+zYY6dbSBGNdZ0AExwPt/3lFS 6i/A== X-Gm-Message-State: AMke39k4nFtQuMr096ajUdN/ojV4//5BQHsY4Pw/9QzSwLFxDt6UDXRTCs4B8ZgBMDt1WegO X-Received: by 10.223.176.20 with SMTP id f20mr7701877wra.160.1488644654899; Sat, 04 Mar 2017 08:24:14 -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.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 04 Mar 2017 08:24:14 -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 10/12] gpio: mxc: use devm_irq_alloc_descs() Date: Sat, 4 Mar 2017 17:23:38 +0100 Message-Id: <1488644620-11488-11-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 interrupt descriptors it allocates. Fix it by using the resource managed version of irq_alloc_descs(). Signed-off-by: Bartosz Golaszewski --- drivers/gpio/gpio-mxc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c index c1a1e00..3abea3f 100644 --- a/drivers/gpio/gpio-mxc.c +++ b/drivers/gpio/gpio-mxc.c @@ -471,7 +471,7 @@ static int mxc_gpio_probe(struct platform_device *pdev) if (err) 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) { err = irq_base; goto out_bgio; @@ -481,7 +481,7 @@ static int mxc_gpio_probe(struct platform_device *pdev) &irq_domain_simple_ops, NULL); if (!port->domain) { err = -ENODEV; - goto out_irqdesc_free; + goto out_bgio; } /* gpio-mxc can be a generic irq chip */ @@ -495,8 +495,6 @@ static int mxc_gpio_probe(struct platform_device *pdev) out_irqdomain_remove: irq_domain_remove(port->domain); -out_irqdesc_free: - irq_free_descs(irq_base, 32); out_bgio: dev_info(&pdev->dev, "%s failed with errno %d\n", __func__, err); return err;