From patchwork Wed Aug 2 07:51:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 796535 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="BD24dT68"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3xMlmQ4Sssz9sRW for ; Wed, 2 Aug 2017 17:53:10 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752123AbdHBHwq (ORCPT ); Wed, 2 Aug 2017 03:52:46 -0400 Received: from mail-wm0-f53.google.com ([74.125.82.53]:36198 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751677AbdHBHvo (ORCPT ); Wed, 2 Aug 2017 03:51:44 -0400 Received: by mail-wm0-f53.google.com with SMTP id t201so34040664wmt.1 for ; Wed, 02 Aug 2017 00:51:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=UqtBRN3zNyha6rYjpTAHtBlqhoYylVLBLtptex6ZnoY=; b=BD24dT68V+AFMMkbgupMYeokiFqONDGQ7dzv3oE7KNxrBhmlBGc9JxHkgDJd6cs6Pw KJkpYT2ASaU6NPLO+ca/8G5l9umhjDrtKP02EZ+fZx4cYCabv/hIfaKrG7QQwOtDRB37 SEcJMJLa5IOr5T1AW5J6CH2kFnHfbaeuLArgGSiseSEPGfzyJLIWfyIEMvgunn1BGCps YD6wrooVP92NP09Bzsukhc3LeCuiRattsGnVKUieLBitnZ/RmnZrrjPHa+lvDTmvyz4z Kn3GUx03evFXjKCwyLUJ0kPOfW7FgM2bQYtVWkqAZFMBTqlUtaXz0gLTintrQ3YSbrC8 9wuw== 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=UqtBRN3zNyha6rYjpTAHtBlqhoYylVLBLtptex6ZnoY=; b=geeKcK3aYMYMrtFBXy/QswkZh2JBghRTLet8398qHcVOurtYE5ZwwBkTm5tvFzXYZV ksWOHfRdupzWS00mm+P/oSSY8Dya9Mzqt2trgKfEtUSvqi22jBfr2Z0l5Dav+tvwWcz+ AqTvqSEdwU8sN/yL0qbob8MgG493RqAKKIyMSA221SWVTztN/VthoXzLUX4lu3nwT8Dh 4IHDO+4TxQKybJ2pxD+wKoyG1RWnRBToViCuXNhiiYdxjHEt7adUq9xoCYzs9HFLp11b WrXPANYg90+iEknszcRD8WSHOW+Ti+tw1nNOARKf0XuA1/7/cgUJtQNnKpNPMRMy9qXG L7rQ== X-Gm-Message-State: AIVw110AqqDlgTrpP/7eOkKyk9/byhtcSVEdmTO6m2iFvmTWnsTXdMzX rOHw5BgKlY0p1gMM X-Received: by 10.28.9.19 with SMTP id 19mr3242602wmj.61.1501660303275; Wed, 02 Aug 2017 00:51:43 -0700 (PDT) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id j29sm15465741wrb.9.2017.08.02.00.51.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Aug 2017 00:51:42 -0700 (PDT) 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-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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,