From patchwork Wed Jan 30 15:17:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ren=C3=A9_van_Dorst?= X-Patchwork-Id: 10788823 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4122E746 for ; Wed, 30 Jan 2019 15:22:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E2692F92A for ; Wed, 30 Jan 2019 15:22:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B85F2F94F; Wed, 30 Jan 2019 15:22:42 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4E4722F953 for ; Wed, 30 Jan 2019 15:22:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=AmPr9qlsZLNVqAnR1k7Dv7a4ck3x3zpzon3VTX6i/nM=; b=uX64P4vYZUI2Dh NP25iWE872qvJIEe8Zffu2Wo3ccIbYc6WYNLW/pgsVyfnaRDb6t4grS73wAyXGOwpXefTZj99BCuu d7xVbX+cp3+2wCaqoozaqr2q6cbLyVp29qqMm/u02HpkEmew+WYsOi1cOlfAlKgci5Ty5yzxF4Xp6 k8S9sVKuyulx5+tp8gqbfGTrhkzkwdV9YsE9p84RZTWLw8Skab+MBvDyqUKU8DweZ3kXxDAhTyy1Y etro5cSNlX62DXF6rGB81GOAgB0AijSyGERiZnsMrdAyLdRRHOIezTUbqc6V/m674tFRRXBWHtqY/ KDWeT5c43GIItZRGIgVQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gorhI-00007x-Ro; Wed, 30 Jan 2019 15:22:40 +0000 Received: from mail.0dd.nl ([5.2.79.48]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gorhD-00007U-Hk for linux-mediatek@lists.infradead.org; Wed, 30 Jan 2019 15:22:39 +0000 Received: from mail.vdorst.com (mail.vdorst.com [IPv6:fd01::250]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.0dd.nl (Postfix) with ESMTPS id 4FE3A5FBBA; Wed, 30 Jan 2019 16:22:24 +0100 (CET) Received: from pc-rene.vdorst.com (unknown [IPv6:2a02:a453:deab:1:da50:e6ff:fed1:4a04]) by mail.vdorst.com (Postfix) with ESMTPA id 0DDA8144C91E; Wed, 30 Jan 2019 16:22:24 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.vdorst.com 0DDA8144C91E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vdorst.com; s=default; t=1548861744; bh=JF0dTctfXgSXWQRQCTPuh8lIEh9XuEALAGVlyt/te34=; h=From:To:Cc:Subject:Date:From; b=Zx9ZcNVwoY37A2lvC/swons2GPZlU6nfU0t0y0QSwSyBxSJ/BPG7+Byow/gI0R4wj Db1erdPO+YMIBahBBNxctEprnBAvvtAIwttoq5iVxNvSDD0O4JVUZNHHrwqdmc0Qpb R9mmDPTq+xLTaSvg5v836lcaMiywHVvCcGoF8xog9nGB0VLC6yNhCtfkHCn8sBoh1v DhvYT+ebPARvbvwYSD9ICjNcbvoHrzatf2RGiWkMBmzcdN1YmjKMt1YC9R1wJYc8nn kGAtEhjo9UiRsk/YlqSHinElfCJ9mDQSTUj1k0bUhEPpuluSsPU7BzQ8Zbl7ihYpBW 9tylux9IslapA== From: =?utf-8?q?Ren=C3=A9_van_Dorst?= To: Linus Walleij , Bartosz Golaszewski , Matthias Brugger Subject: [PATCH] gpio: MT7621: use a per instance irq_chip structure Date: Wed, 30 Jan 2019 16:17:48 +0100 Message-Id: <20190130151744.11145-1-opensource@vdorst.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190130_072236_270367_C48CF461 X-CRM114-Status: GOOD ( 11.04 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Ren=C3=A9_van_Dorst?= , gerg@kernel.org, linux-mediatek@lists.infradead.org, linux-gpio@vger.kernel.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This fixes the kernel complains: gpio gpiochip1: (1e000600.gpio-bank1): detected irqchip that is shared with multiple gpiochips: please fix the driver. gpio gpiochip2: (1e000600.gpio-bank2): detected irqchip that is shared with multiple gpiochips: please fix the driver. Signed-off-by: René van Dorst Cc: linux-gpio@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: gerg@kernel.org --- drivers/gpio/gpio-mt7621.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/gpio/gpio-mt7621.c b/drivers/gpio/gpio-mt7621.c index 00e954f22bc9..89fb000480dc 100644 --- a/drivers/gpio/gpio-mt7621.c +++ b/drivers/gpio/gpio-mt7621.c @@ -30,6 +30,7 @@ #define GPIO_REG_EDGE 0xA0 struct mtk_gc { + struct irq_chip irq_chip; struct gpio_chip chip; spinlock_t lock; int bank; @@ -189,12 +190,6 @@ mediatek_gpio_irq_type(struct irq_data *d, unsigned int type) return 0; } -static struct irq_chip mediatek_gpio_irq_chip = { - .irq_unmask = mediatek_gpio_irq_unmask, - .irq_mask = mediatek_gpio_irq_mask, - .irq_mask_ack = mediatek_gpio_irq_mask, - .irq_set_type = mediatek_gpio_irq_type, -}; static int mediatek_gpio_xlate(struct gpio_chip *chip, @@ -254,6 +249,13 @@ mediatek_gpio_bank_probe(struct device *dev, return ret; } + rg->irq_chip.name = dev_name(dev); + rg->irq_chip.parent_device = dev; + rg->irq_chip.irq_unmask = mediatek_gpio_irq_unmask; + rg->irq_chip.irq_mask = mediatek_gpio_irq_mask; + rg->irq_chip.irq_mask_ack = mediatek_gpio_irq_mask; + rg->irq_chip.irq_set_type = mediatek_gpio_irq_type; + if (mtk->gpio_irq) { /* * Manually request the irq here instead of passing @@ -270,14 +272,14 @@ mediatek_gpio_bank_probe(struct device *dev, return ret; } - ret = gpiochip_irqchip_add(&rg->chip, &mediatek_gpio_irq_chip, + ret = gpiochip_irqchip_add(&rg->chip, &rg->irq_chip, 0, handle_simple_irq, IRQ_TYPE_NONE); if (ret) { dev_err(dev, "failed to add gpiochip_irqchip\n"); return ret; } - gpiochip_set_chained_irqchip(&rg->chip, &mediatek_gpio_irq_chip, + gpiochip_set_chained_irqchip(&rg->chip, &rg->irq_chip, mtk->gpio_irq, NULL); } @@ -310,7 +312,6 @@ mediatek_gpio_probe(struct platform_device *pdev) mtk->gpio_irq = irq_of_parse_and_map(np, 0); mtk->dev = dev; platform_set_drvdata(pdev, mtk); - mediatek_gpio_irq_chip.name = dev_name(dev); for (i = 0; i < MTK_BANK_CNT; i++) { ret = mediatek_gpio_bank_probe(dev, np, i);