From patchwork Sat Mar 4 16:23:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 9604117 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 F3C2B602B4 for ; Sat, 4 Mar 2017 16:31:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E765028478 for ; Sat, 4 Mar 2017 16:31:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC44328555; Sat, 4 Mar 2017 16:31:24 +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 4CBB128478 for ; Sat, 4 Mar 2017 16:31:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752288AbdCDQbX (ORCPT ); Sat, 4 Mar 2017 11:31:23 -0500 Received: from mail-wm0-f52.google.com ([74.125.82.52]:36251 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752215AbdCDQaj (ORCPT ); Sat, 4 Mar 2017 11:30:39 -0500 Received: by mail-wm0-f52.google.com with SMTP id n11so35532955wma.1 for ; Sat, 04 Mar 2017 08:30:29 -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=4Tmd0aGiWM94+WOTHu1qfqKhE/FSabbdg0XRRNBh+1I=; b=dEXT5l23J6hZgmqcx9ohEAtffBP3ahQg4OZMBT3EDT9q4Xr3QKAD5MO2UpiNbx2A5e 2+6aYQ+AzMDOw/VDwtrRqnsgQ6ub04RSuqIS6lkvot/R+u6gK3WNb+3ysV7TLbJDakpP 45FNLJZY3vXP7zQSg7MC5EMdWAtORje0DPUASUkYiPCtXPEC82d37XrglhtCE9JTItF7 BFUB3bwNla+94qcRxyWJ6l9jbnYiaHrOkbnBMwdwifnGwlcADlUe5dRHj2Ig18OpF6z+ gHTKCJJEJJ9N0hOCOAuNZ2H19sq1Q4bs3RCGKrpr9oFHbwRXH9P3fW+3MdanTRp3JNyg Q3hA== 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=4Tmd0aGiWM94+WOTHu1qfqKhE/FSabbdg0XRRNBh+1I=; b=WaolQG5ulVtFyGM2ZzKAJml2cqDEQJNWwYOa2d2w0HjpibjNK2NdDkSDooxvK9SLHa Tuf6ouJgWJnVTISa5TD2PE0zVeVPEBMzNvXQxIQT54vH3cfkpr8bNAsd6dJEvsPpU1sK KiMH2lGrPMBQLSv/yn5p5d8cfFT7MOzeS2yBwERHtHM0yWPmTZOTvXDynmz+pIfCAe49 bni5xDPMYIXnfYDFjztwlJySwv9otbXshVq3+8Zxc8CA2Rd2wcNWP2eqPVMywcLO8L3W NDvMWvMtpgtaPIW2DW+iwjxew9OOzdq1Aodu+pxzA7JG/1ICdxjTOBW2qtyeqzUngHHZ q4/Q== X-Gm-Message-State: AMke39lh0NfdqL4fkdsPLZGZWByI8kXIt4k8byjQRnGKbbrs4vF7uxWU/SiFiHoyFfGb7PZY X-Received: by 10.28.109.93 with SMTP id i90mr7365179wmc.44.1488644648893; Sat, 04 Mar 2017 08:24:08 -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.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 04 Mar 2017 08:24:08 -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 06/12] gpio: xlp: use resource management for irqs Date: Sat, 4 Mar 2017 17:23:34 +0100 Message-Id: <1488644620-11488-7-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 Use the resource managed variant of irq_alloc_descs() and remove the code manually freeing allocated interrupt descriptors. Signed-off-by: Bartosz Golaszewski --- drivers/gpio/gpio-xlp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-xlp.c b/drivers/gpio/gpio-xlp.c index 4620d05..7cc82cf 100644 --- a/drivers/gpio/gpio-xlp.c +++ b/drivers/gpio/gpio-xlp.c @@ -404,7 +404,9 @@ static int xlp_gpio_probe(struct platform_device *pdev) /* XLP(MIPS) has fixed range for GPIO IRQs, Vulcan(ARM64) does not */ if (soc_type != GPIO_VARIANT_VULCAN) { - irq_base = irq_alloc_descs(-1, XLP_GPIO_IRQ_BASE, gc->ngpio, 0); + irq_base = devm_irq_alloc_descs(&pdev->dev, -1, + XLP_GPIO_IRQ_BASE, + gc->ngpio, 0); if (irq_base < 0) { dev_err(&pdev->dev, "Failed to allocate IRQ numbers\n"); return irq_base; @@ -415,7 +417,7 @@ static int xlp_gpio_probe(struct platform_device *pdev) err = gpiochip_add_data(gc, priv); if (err < 0) - goto out_free_desc; + return err; err = gpiochip_irqchip_add(gc, &xlp_gpio_irq_chip, irq_base, handle_level_irq, IRQ_TYPE_NONE); @@ -433,8 +435,6 @@ static int xlp_gpio_probe(struct platform_device *pdev) out_gpio_remove: gpiochip_remove(gc); -out_free_desc: - irq_free_descs(irq_base, gc->ngpio); return err; }