Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752143AbdHBHwr (ORCPT ); Wed, 2 Aug 2017 03:52:47 -0400 Received: from mail-wm0-f48.google.com ([74.125.82.48]:32853 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751066AbdHBHvo (ORCPT ); Wed, 2 Aug 2017 03:51:44 -0400 From: Bartosz Golaszewski To: Linus Walleij Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 3/6] gpio: pch: use devres for irq generic chip Date: Wed, 2 Aug 2017 09:51:23 +0200 Message-Id: <20170802075126.17637-4-brgl@bgdev.pl> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20170802075126.17637-1-brgl@bgdev.pl> References: <20170802075126.17637-1-brgl@bgdev.pl> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1301 Lines: 42 Use resource managed variants of irq_alloc_generic_chip() and irq_setup_generic_chip(). Signed-off-by: Bartosz Golaszewski --- drivers/gpio/gpio-pch.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/gpio/gpio-pch.c b/drivers/gpio/gpio-pch.c index f6600f8ada52..68c6d0c5a6d1 100644 --- a/drivers/gpio/gpio-pch.c +++ b/drivers/gpio/gpio-pch.c @@ -337,9 +337,10 @@ static int pch_gpio_alloc_generic_chip(struct pch_gpio *chip, { struct irq_chip_generic *gc; struct irq_chip_type *ct; + int rv; - gc = irq_alloc_generic_chip("pch_gpio", 1, irq_start, chip->base, - handle_simple_irq); + gc = devm_irq_alloc_generic_chip(chip->dev, "pch_gpio", 1, irq_start, + chip->base, handle_simple_irq); if (!gc) return -ENOMEM; @@ -351,10 +352,11 @@ static int pch_gpio_alloc_generic_chip(struct pch_gpio *chip, ct->chip.irq_unmask = pch_irq_unmask; ct->chip.irq_set_type = pch_irq_type; - irq_setup_generic_chip(gc, IRQ_MSK(num), IRQ_GC_INIT_MASK_CACHE, - IRQ_NOREQUEST | IRQ_NOPROBE, 0); + rv = devm_irq_setup_generic_chip(chip->dev, gc, IRQ_MSK(num), + IRQ_GC_INIT_MASK_CACHE, + IRQ_NOREQUEST | IRQ_NOPROBE, 0); - return 0; + return rv; } static int pch_gpio_probe(struct pci_dev *pdev, -- 2.13.2