From patchwork Wed Aug 2 07:51:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 796531 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="16tvI9aK"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3xMllJ6J22z9t2J for ; Wed, 2 Aug 2017 17:52:12 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752074AbdHBHvu (ORCPT ); Wed, 2 Aug 2017 03:51:50 -0400 Received: from mail-wr0-f182.google.com ([209.85.128.182]:38775 "EHLO mail-wr0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752031AbdHBHvr (ORCPT ); Wed, 2 Aug 2017 03:51:47 -0400 Received: by mail-wr0-f182.google.com with SMTP id f21so15279518wrf.5 for ; Wed, 02 Aug 2017 00:51:46 -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=hjrk8DW2wv/lgeA77E3l5A2e4KSCunJFfaM08A+NDH0=; b=16tvI9aK4abDiFXridlMW0T5NkpUF3XB6wM5dkwxDt79JypDxTZQHTRtgH1Cc/29Y8 4u6vT5gaPCj0/upvIXAEJSHq0jWEPG/0Td9v6fngxGrtqewfeiT4LUEoiZtzQioLJMvz xVwqD8RGkxu3vrHYtoN2ERMumESDJWug2rNs6cacSiyINpFnkQF54+aas+G0dNoyrYuP P4a784Y3wf3InfscRETkrjmcDg4Z/IcIhXS0flBPdGr1r9cNdja4hcoAio4mkDbKRUv4 JDI3UmEXc1TlamguKKm7H9SK6RYVnX0MnTFICYsp0epKrKhDP7CQbYmqS44BaiCGJ2Y5 wXAg== 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=hjrk8DW2wv/lgeA77E3l5A2e4KSCunJFfaM08A+NDH0=; b=nWk5UHYVNV1ZbpaVwxckfkCDCUU7+megQGpdla8ivW53i0Xk1ZsitMjpdVLQdlr09p e19aAtj3VGrWTadqvs0fo+zBLOpiBPmmOPqow0MQ9JIB8aYOyrDxlZeFaZB9utepjJio gKrqKl13xzknRcdxqZE5s9D/vPiGOSc6rJW0NQinDRIc8w5JkaIDxzeQCwgYO2X6Dk2w qxKk/L6YDogG/J3NkD3MzFQ8R1x/gQNDwuMoSpj2nd2gp+dlYbGq5kTUGOl/vrrUYseJ U38TWOLt5hNTbsDPevp38VjSrc5jRzgOyJGSqcclDOz9s0OWYvAEPHBkZv8rnhiMSoJq p0mA== X-Gm-Message-State: AIVw1105PH9/VMQORzOmx+U6AdmHI2wX2NlE6tcYkVXqcZDKuI3LZZ8k beWhgB4VpuMUswnp X-Received: by 10.223.179.196 with SMTP id x4mr5811216wrd.86.1501660306120; Wed, 02 Aug 2017 00:51:46 -0700 (PDT) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id j29sm15465741wrb.9.2017.08.02.00.51.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Aug 2017 00:51:45 -0700 (PDT) From: Bartosz Golaszewski To: Linus Walleij Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 6/6] gpio: sodaville: use devres for irq generic chip Date: Wed, 2 Aug 2017 09:51:26 +0200 Message-Id: <20170802075126.17637-7-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-sodaville.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/gpio/gpio-sodaville.c b/drivers/gpio/gpio-sodaville.c index f60da83349ef..20a39f5ac361 100644 --- a/drivers/gpio/gpio-sodaville.c +++ b/drivers/gpio/gpio-sodaville.c @@ -155,8 +155,9 @@ static int sdv_register_irqsupport(struct sdv_gpio_chip_data *sd, * we unmask & ACK the IRQ before the source of the interrupt is gone * then the interrupt is active again. */ - sd->gc = irq_alloc_generic_chip("sdv-gpio", 1, sd->irq_base, - sd->gpio_pub_base, handle_fasteoi_irq); + sd->gc = devm_irq_alloc_generic_chip(&pdev->dev, "sdv-gpio", 1, + sd->irq_base, sd->gpio_pub_base, + handle_fasteoi_irq); if (!sd->gc) return -ENOMEM; @@ -170,9 +171,13 @@ static int sdv_register_irqsupport(struct sdv_gpio_chip_data *sd, ct->chip.irq_eoi = irq_gc_eoi; ct->chip.irq_set_type = sdv_gpio_pub_set_type; - irq_setup_generic_chip(sd->gc, IRQ_MSK(SDV_NUM_PUB_GPIOS), - IRQ_GC_INIT_MASK_CACHE, IRQ_NOREQUEST, - IRQ_LEVEL | IRQ_NOPROBE); + ret = devm_irq_setup_generic_chip(&pdev->dev, sd->gc, + IRQ_MSK(SDV_NUM_PUB_GPIOS), + IRQ_GC_INIT_MASK_CACHE, + IRQ_NOREQUEST, + IRQ_LEVEL | IRQ_NOPROBE); + if (ret) + return ret; sd->id = irq_domain_add_legacy(pdev->dev.of_node, SDV_NUM_PUB_GPIOS, sd->irq_base, 0, &irq_domain_sdv_ops, sd);