Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp822722imc; Sun, 10 Mar 2019 23:28:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqxf+GA9sRyHVtLZcAx0UvHBfIYnUOob36l6MYl7+lhPg1hv+6SXJi1IegTr2DNHfb8BkaCJ X-Received: by 2002:a65:49c4:: with SMTP id t4mr29031940pgs.421.1552285726973; Sun, 10 Mar 2019 23:28:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552285726; cv=none; d=google.com; s=arc-20160816; b=tiGlJEKACPbvfJVUR6xWnbgJhWCCdoC2E6fuoPvYcyulufJKRPX+f2R0EoAU+X23ae gTsm1PleE6GQbYf54JRHfJ50L5eUf/jFGjRsdo7+xirTXLw4w6HeTopbiHUB54gCvcff KkPRaQHbZkHrk1vXhfnLnAyyh6Wdh1n72VmGSrjDQ4tKgTxafEDxSwj2BjfVGOFbx0SX p7trOx2lgQIT0HtPs1RDe/I1jeZVV7uba4Y2NQq73auWLB6fUSBHf2CE7Qwm2kAPlRYf vScQux4nAYQwAqGIwXbB2XJWRoFM/LywS5IritLuvIbw+jkHNhR7uLYAXJXavonPqf+R b4xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=FucV4xmaQpW0g5ag0DNsjakkAYyguzHLUsgHU2+3MJM=; b=tEWkQNuNyAtk7UrAhSFpGMNoDbya9JWGL20DvV8zexX7aUenpJACvb7INstzXNvscj Wdz0omvYwrRVc8bKzbdatPqCdAXN1tOJow6P3HeJ18UW4abaxxD0ZiAVKNmBuRxFF6g5 Egy6MvxL7heICJzBkiXizo7EjRDmOtxsl13U5ydhei0NcTGMR443KEgVb9WM0IVibG/B EA5Kj7zoE44GnziaC6CecFl+LR13wX8lr1b1Bex4h8pkRTdHQnOPEqp/RMYPTtlekFmh cT2eE+JDSEz40oj0msTLmBr0I6OYl++so9nNdQQEHexhwcX8eRt6EqnqH81DfKjaW+IW cH5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WQJg6c0h; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i15si4327539pfa.270.2019.03.10.23.28.31; Sun, 10 Mar 2019 23:28:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WQJg6c0h; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726693AbfCKG2J (ORCPT + 99 others); Mon, 11 Mar 2019 02:28:09 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:41023 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726633AbfCKG2H (ORCPT ); Mon, 11 Mar 2019 02:28:07 -0400 Received: by mail-pf1-f193.google.com with SMTP id d25so2964829pfn.8; Sun, 10 Mar 2019 23:28:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FucV4xmaQpW0g5ag0DNsjakkAYyguzHLUsgHU2+3MJM=; b=WQJg6c0h9PEPWkuhREut2WFmWqxBv05+kjsy92DB+r2DPNDe+wH9rjjHeE6fkwWj9c jatd8P4Dp20Fu5930yJEuZKSV/GplhYMfcs75tIAPzkhYRLHESFnG+U++bvQRvsDerJs sfF9sRvkXVeJvtbz5KEZGuGaXYzr9uyo9VZRJKuo87MzBLRz5slSQkjNt7tc66gB0eRO G2KZjOOx2AojV0aO6H05Eby0Lw8Ir7ryBDvhIf/2gEaF2Xp+DUh1ppKdbUeMzmZWIgdf wLRmEJCl9UxkMbEFk3vbHJe/TMjhihH8pm/0M2bq3ubEMucr7uokLI5bC9Cyktbo8t5q jkVg== 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:mime-version:content-transfer-encoding; bh=FucV4xmaQpW0g5ag0DNsjakkAYyguzHLUsgHU2+3MJM=; b=UulMMexQ1o4wEgYS4/SPJ3ahktqmM9jEc2p1Rd90H9fofwGaI2hmWK/gaSY10MkYON ECGbhDvL8vw3YPgdzePUZc0GG1tSKOEd6RBAiZ+mMEMN5PXSqFlzIKYaUu73b2Aap3+H AUPAokbPDZov2Fb7H2uVdT/tSPnJHFTpZpA1I3bQqNHM6SYVEvfhXkdZM0o2XqLW6RYp 4ro5cbE9ovHoGaLzHOh0zzLB6nLE2jWn/xME4Edyw+JGENh5h2h2OIOGcGFrhpyRpQ59 I4v8dPNM1EWE5rAzlwHM4zjsnVqVwhEun+4R6H42+sAIWrhpPjzjyv/gDaG5wX6sulF6 DQ9w== X-Gm-Message-State: APjAAAVwnxtWK6ZcUQUVPehwEplSN6CsP7vbJgSKzylWH9zepqoeDuZ6 rGnr9l4P+YktfUncMFBN0IFeXNabs7g= X-Received: by 2002:a63:5721:: with SMTP id l33mr3313762pgb.300.1552285686381; Sun, 10 Mar 2019 23:28:06 -0700 (PDT) Received: from squirtle.lan (c-24-22-235-96.hsd1.wa.comcast.net. [24.22.235.96]) by smtp.gmail.com with ESMTPSA id f192sm10241679pfc.180.2019.03.10.23.28.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 10 Mar 2019 23:28:05 -0700 (PDT) From: Andrey Smirnov To: linux-gpio@vger.kernel.org Cc: Andrey Smirnov , Linus Walleij , Bartosz Golaszewski , Chris Healy , Andrew Lunn , Heiner Kallweit , Fabio Estevam , linux-kernel@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH 1/7] gpio: vf610: Do not share irq_chip Date: Sun, 10 Mar 2019 23:27:31 -0700 Message-Id: <20190311062737.6652-2-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190311062737.6652-1-andrew.smirnov@gmail.com> References: <20190311062737.6652-1-andrew.smirnov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the warning produced by gpiochip_set_irq_hooks() by allocating a dedicated IRQ chip per GPIO chip/port. Signed-off-by: Andrey Smirnov Cc: Linus Walleij Cc: Bartosz Golaszewski Cc: Chris Healy Cc: Andrew Lunn Cc: Heiner Kallweit Cc: Fabio Estevam Cc: linux-gpio@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-imx@nxp.com --- drivers/gpio/gpio-vf610.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c index 541fa6ac399d..7e9451f47efe 100644 --- a/drivers/gpio/gpio-vf610.c +++ b/drivers/gpio/gpio-vf610.c @@ -29,6 +29,7 @@ struct fsl_gpio_soc_data { struct vf610_gpio_port { struct gpio_chip gc; + struct irq_chip ic; void __iomem *base; void __iomem *gpio_base; const struct fsl_gpio_soc_data *sdata; @@ -60,8 +61,6 @@ struct vf610_gpio_port { #define PORT_INT_EITHER_EDGE 0xb #define PORT_INT_LOGIC_ONE 0xc -static struct irq_chip vf610_gpio_irq_chip; - static const struct fsl_gpio_soc_data imx_data = { .have_paddr = true, }; @@ -237,15 +236,6 @@ static int vf610_gpio_irq_set_wake(struct irq_data *d, u32 enable) return 0; } -static struct irq_chip vf610_gpio_irq_chip = { - .name = "gpio-vf610", - .irq_ack = vf610_gpio_irq_ack, - .irq_mask = vf610_gpio_irq_mask, - .irq_unmask = vf610_gpio_irq_unmask, - .irq_set_type = vf610_gpio_irq_set_type, - .irq_set_wake = vf610_gpio_irq_set_wake, -}; - static int vf610_gpio_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -253,6 +243,7 @@ static int vf610_gpio_probe(struct platform_device *pdev) struct vf610_gpio_port *port; struct resource *iores; struct gpio_chip *gc; + struct irq_chip *ic; int i; int ret; @@ -316,6 +307,14 @@ static int vf610_gpio_probe(struct platform_device *pdev) gc->direction_output = vf610_gpio_direction_output; gc->set = vf610_gpio_set; + ic = &port->ic; + ic->name = "gpio-vf610"; + ic->irq_ack = vf610_gpio_irq_ack; + ic->irq_mask = vf610_gpio_irq_mask; + ic->irq_unmask = vf610_gpio_irq_unmask; + ic->irq_set_type = vf610_gpio_irq_set_type; + ic->irq_set_wake = vf610_gpio_irq_set_wake; + ret = gpiochip_add_data(gc, port); if (ret < 0) return ret; @@ -327,14 +326,13 @@ static int vf610_gpio_probe(struct platform_device *pdev) /* Clear the interrupt status register for all GPIO's */ vf610_gpio_writel(~0, port->base + PORT_ISFR); - ret = gpiochip_irqchip_add(gc, &vf610_gpio_irq_chip, 0, - handle_edge_irq, IRQ_TYPE_NONE); + ret = gpiochip_irqchip_add(gc, ic, 0, handle_edge_irq, IRQ_TYPE_NONE); if (ret) { dev_err(dev, "failed to add irqchip\n"); gpiochip_remove(gc); return ret; } - gpiochip_set_chained_irqchip(gc, &vf610_gpio_irq_chip, port->irq, + gpiochip_set_chained_irqchip(gc, ic, port->irq, vf610_gpio_irq_handler); return 0; -- 2.20.1