From patchwork Sat Mar 4 16:23:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 9604139 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 81FD9602B4 for ; Sat, 4 Mar 2017 16:34:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7328B28509 for ; Sat, 4 Mar 2017 16:34:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 66A8428510; Sat, 4 Mar 2017 16:34:35 +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 DBFD828509 for ; Sat, 4 Mar 2017 16:34:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752531AbdCDQeF (ORCPT ); Sat, 4 Mar 2017 11:34:05 -0500 Received: from mail-wr0-f174.google.com ([209.85.128.174]:34922 "EHLO mail-wr0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752371AbdCDQeC (ORCPT ); Sat, 4 Mar 2017 11:34:02 -0500 Received: by mail-wr0-f174.google.com with SMTP id g10so91310691wrg.2 for ; Sat, 04 Mar 2017 08:33:33 -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=13/WyEtuTITc99oZQgKG2oGJ/dDiZqofGmlDiQ1d8Ac=; b=tfv0f+ZBq/m0V7zuQv/S7kMU/OjWkSUY1Tc5Of8lnC2R/MD1XkNAloVoMQY+caQVAn Pjht7kqPkJUwif+dFEPjGm7Av5+U+OZ2FU+uqQDSXbuTxjVdfCcRT1XcVG35P8rYekYX OGQ5HMNR9WR+f5qwQ0C3VbaXP9id8+ewZWRmRWdzSDq3KW1X4tESy9sn/347RsUHWbb1 lIejZCLZPnlKhl5QEIOk6vtrQt3zUxT+OFcDPRs1jffY0s7qLkHaiZMU0826F0B7lDMh ZL2mpYpx1jS/SC8gFyN99ffGyxgoBZG+3/a6mG7R74wN4wpZoMkPvkLnjOzbkGQLG8TP RlEA== 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=13/WyEtuTITc99oZQgKG2oGJ/dDiZqofGmlDiQ1d8Ac=; b=KE8B2P9/WZR0+47i2vHG2ojLgHRR95BxYa6MWGqzcD2kYo2SjsMRyfjpUgrHVrnXcN EhVKzou1do7UztMRNGpI6aPL+IFrOMo51N1DBa4y2bNRNVfVM81ec2HIgKbRgDtmKcqP x6ptzmTpBF+8XTCoolpTdHBDEdKZFkHVCQ7YAeIzjNbpVDFn0+qh0LAVL7/gYGl3qaT8 NagzX1rWHKZ420xS7DX1GGDygTtpbivLrCuirD1Cv7INCJFEjWvCGqrz+/oc3Z2mcih9 NOnu0zpLM7F8vSVDEQFojqoU8JBjDNJ0kDDoTwyZV5x5vY3XJKyyqaJ/OQJG6FuCoQJq ErSA== X-Gm-Message-State: AMke39kive8YhxLGUa116Hwa7aqMvkvnQa7MHQULuFim5RQCSAnhAP6jeLi52IxMSQ38XJtC X-Received: by 10.223.142.40 with SMTP id n37mr7019088wrb.137.1488644656418; Sat, 04 Mar 2017 08:24:16 -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.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 04 Mar 2017 08:24:15 -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 11/12] gpio: mxs: use devm_irq_alloc_descs() Date: Sat, 4 Mar 2017 17:23:39 +0100 Message-Id: <1488644620-11488-12-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-mxs.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-mxs.c b/drivers/gpio/gpio-mxs.c index 2292742..6ae583f 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;