From patchwork Sat Mar 4 16:23:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 9604159 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 1FAD5601D2 for ; Sat, 4 Mar 2017 16:54:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11503283F4 for ; Sat, 4 Mar 2017 16:54:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 049862846A; Sat, 4 Mar 2017 16:54:31 +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 7FD39283F4 for ; Sat, 4 Mar 2017 16:54:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752348AbdCDQya (ORCPT ); Sat, 4 Mar 2017 11:54:30 -0500 Received: from mail-wr0-f180.google.com ([209.85.128.180]:34228 "EHLO mail-wr0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752285AbdCDQya (ORCPT ); Sat, 4 Mar 2017 11:54:30 -0500 Received: by mail-wr0-f180.google.com with SMTP id l37so91632595wrc.1 for ; Sat, 04 Mar 2017 08:54: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=L9JnaCzNcvdxt2Vi1CXVIp0h0feX6+x54euHmB/1OQY=; b=pBYNi4Rg3Pk/VL8EwQ5H6JcfYtOBWzfFsIpm6E2hojtms8SXcguFPP5Hw+6aUfP5GC NYjNzbW/8qIYr8BgfVkKb2q/k+O/L7fu8CMp0Rd6dQ1QkRM2Q8C38MWVsTrLakYPCtix 2Q2DZHuqSVrqwLioRF0geUNnzyEsDRxgWbUMtyn1eVbMVEoLr9quvDWTZd6DPq4/Nrkt Bbj8rScpthcpEjz+58Ab3I8eDy3h7zCKMhE3Rznob7KK4kOv6e0oxYpqudb2Y8++C7eP Bx/PniMmPseZhSqZYmEsViFSj3URqw6/v7BmIe0TxgUGefGitgbK7k2IcLylSSwNxGrf 4vyg== 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=L9JnaCzNcvdxt2Vi1CXVIp0h0feX6+x54euHmB/1OQY=; b=jIv6rvt1s+UQbuDvy81oeC8GuvWyRxx/HGQIilgS3H7WqARDSP3yhdAxWVzXO7CR/a i7hPcFKNtI1oWa320bFAXnI4H05KK6JvKdbMzTWmOW+szyLrSti0e3gilNImEbvx84b3 5hTUn30ACYphpXj3bm7GgDrj4wgVd5urjtTsLHJpdcQgLmOHnNkc58t753GU/eVvgBf9 guiy4MWynkiYgFrjyTXccnjGxKr/GV0UdtIe1B4WYWA0PtRZmaA+BwMe7evpN2/rW+20 iFr/P5fv7LFYKpzZMTVmF7FKfl7vfDOYOD8Eag9APOVGbiw4bkywerZ7Va17Qfsvb60C HLyg== X-Gm-Message-State: AMke39lDYna3Qub2mHclKjK1cltN3OY1Ff2zI/CYoMPr9QrIjtPCmV0oNojHoskBXwa6+w1e X-Received: by 10.223.176.20 with SMTP id f20mr7701282wra.160.1488644641208; Sat, 04 Mar 2017 08:24:01 -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.23.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 04 Mar 2017 08:24:00 -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 01/12] gpio: mockup: use devm_irq_alloc_descs() Date: Sat, 4 Mar 2017 17:23:29 +0100 Message-Id: <1488644620-11488-2-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(). This allows us to remove gpio_mockup_remove(). Signed-off-by: Bartosz Golaszewski Reviewed-by: Bamvor Jian Zhang --- drivers/gpio/gpio-mockup.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/gpio/gpio-mockup.c b/drivers/gpio/gpio-mockup.c index 06dac72..37c2d69 100644 --- a/drivers/gpio/gpio-mockup.c +++ b/drivers/gpio/gpio-mockup.c @@ -169,7 +169,7 @@ static int gpio_mockup_irqchip_setup(struct device *dev, struct gpio_chip *gc = &chip->gc; int irq_base, i; - irq_base = irq_alloc_descs(-1, 0, gc->ngpio, 0); + irq_base = devm_irq_alloc_descs(dev, -1, 0, gc->ngpio, 0); if (irq_base < 0) return irq_base; @@ -373,25 +373,11 @@ static int gpio_mockup_probe(struct platform_device *pdev) return 0; } -static int gpio_mockup_remove(struct platform_device *pdev) -{ - struct gpio_mockup_chip *chips; - int i; - - chips = platform_get_drvdata(pdev); - - for (i = 0; i < gpio_mockup_params_nr >> 1; i++) - irq_free_descs(chips[i].gc.irq_base, chips[i].gc.ngpio); - - return 0; -} - static struct platform_driver gpio_mockup_driver = { .driver = { .name = GPIO_MOCKUP_NAME, }, .probe = gpio_mockup_probe, - .remove = gpio_mockup_remove, }; static struct platform_device *pdev;