Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2396552imu; Thu, 24 Jan 2019 12:03:35 -0800 (PST) X-Google-Smtp-Source: ALg8bN4FZdyGh2OdiN6Wlf6pZNi18f7zGp8leTFfyKppyC0teY48/gEcJSBf6BFmtZNhQqZSuuCm X-Received: by 2002:a63:e20a:: with SMTP id q10mr7011687pgh.206.1548360215433; Thu, 24 Jan 2019 12:03:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548360215; cv=none; d=google.com; s=arc-20160816; b=Vo50e2jkvMEZ0Qj+c8CZlgOJOjwk78wVmSSCUe9SIDrpmG2i7vzkAaqx3MV38Gz9cy 4hyVuZpBmC8E3HFztSaI39NTvxxFXRMPuEqjoq3sW/G3Pm3m8ZD/ou87Z56vyJh/RLHY ROSthW7NbM1PsOb/eMBFqZ7lfk6ENDC7p+U6RiWDXCLtrLzRr5Hi7hv0H6kktE6H17mH HJpB6qYpWXoBE5E/uouu7SCNxpCJSpkt3E6wp0eaykBvYGaQb3A9r2a8P0RYqiMvT/Rb 1N80ghk4/TkOexNC4Ng4NYZ/s8VyC5BhcPTxH7ITg/dnwI5SlsgBWAJuEFDn8n9VF9OF lO8w== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=quMX7RC2AFrrRdpWBt6jG50HOqfBH9g8no4yt1PPOUI=; b=hto/zkjoHUnixY0Z6VpnxfPBf8bc30xv7ZbDd5qKPTeFuWAO4BIkDDjeCdcn+OFec3 kYJQUZynyvThJqvLx3P3DYFaac6FLdsQ5P8D8NPeT8vNZOUaFFoHZSSDxrOPONa7erpN jsR4hGmlrztTOYNEDEkAi9jBMw/sust/aBNUgrXu6n9+i98s0wr1Ju36L2yaFMEO+Lf0 Zt7Z2qsHXmdWCjds4YJeXD0Q/sYS21fikDvoB2/ljLYa6z9+f3HzykZ60NsMnH9rvckN 5Gew53W4IdYF+zfe4yOoRS5IopPNmwK/ULmK1EV/AZylg/FBsgSsPP8bqdBazi5GSAc6 HoFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Vz4CBg2Y; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s4si22723919pfb.190.2019.01.24.12.03.19; Thu, 24 Jan 2019 12:03:35 -0800 (PST) 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=@kernel.org header.s=default header.b=Vz4CBg2Y; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731865AbfAXTcl (ORCPT + 99 others); Thu, 24 Jan 2019 14:32:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:60482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731391AbfAXTcd (ORCPT ); Thu, 24 Jan 2019 14:32:33 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D365A218D4; Thu, 24 Jan 2019 19:32:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548358352; bh=d8al4UzpjPuSiBnBalV5Z7dun60ObRj/pauS3pjrdfE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vz4CBg2Y+qeQBxDOEamR9q3ne70FXdUjGniip64V1KmOeWcJtt9/oBDU2JrwBdd7H cJrGv7cxjotc/qc/PVghb36OPf00Yf8Vnml2/B8PqeVJC6lpFG+7uVwkNnxJaWdTrj XtdEKRgEXhIISiMUHEStJIbrXJtpZ4vkYzJ50vsM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Manivannan Sadhasivam , Linus Walleij , Sasha Levin Subject: [PATCH 4.14 09/63] gpio: pl061: Move irq_chip definition inside struct pl061 Date: Thu, 24 Jan 2019 20:19:58 +0100 Message-Id: <20190124190156.117620809@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190124190155.176570028@linuxfoundation.org> References: <20190124190155.176570028@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit ed8dce4c6f726b7f3c6bf40859b92a9e32f189c1 ] Keeping the irq_chip definition static will make it shared with multiple giochips in the system. This practice is considered to be bad and now we will get the below warning from gpiolib core: "detected irqchip that is shared with multiple gpiochips: please fix the driver." Hence, move the irq_chip definition from static to `struct pl061` for using a unique irq_chip for each gpiochip. Signed-off-by: Manivannan Sadhasivam Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- drivers/gpio/gpio-pl061.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c index 6aaaab79c205..f6e1e0e306a3 100644 --- a/drivers/gpio/gpio-pl061.c +++ b/drivers/gpio/gpio-pl061.c @@ -54,6 +54,7 @@ struct pl061 { void __iomem *base; struct gpio_chip gc; + struct irq_chip irq_chip; int parent_irq; #ifdef CONFIG_PM @@ -281,15 +282,6 @@ static int pl061_irq_set_wake(struct irq_data *d, unsigned int state) return irq_set_irq_wake(pl061->parent_irq, state); } -static struct irq_chip pl061_irqchip = { - .name = "pl061", - .irq_ack = pl061_irq_ack, - .irq_mask = pl061_irq_mask, - .irq_unmask = pl061_irq_unmask, - .irq_set_type = pl061_irq_type, - .irq_set_wake = pl061_irq_set_wake, -}; - static int pl061_probe(struct amba_device *adev, const struct amba_id *id) { struct device *dev = &adev->dev; @@ -328,6 +320,13 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id) /* * irq_chip support */ + pl061->irq_chip.name = dev_name(dev); + pl061->irq_chip.irq_ack = pl061_irq_ack; + pl061->irq_chip.irq_mask = pl061_irq_mask; + pl061->irq_chip.irq_unmask = pl061_irq_unmask; + pl061->irq_chip.irq_set_type = pl061_irq_type; + pl061->irq_chip.irq_set_wake = pl061_irq_set_wake; + writeb(0, pl061->base + GPIOIE); /* disable irqs */ irq = adev->irq[0]; if (irq < 0) { @@ -336,14 +335,14 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id) } pl061->parent_irq = irq; - ret = gpiochip_irqchip_add(&pl061->gc, &pl061_irqchip, + ret = gpiochip_irqchip_add(&pl061->gc, &pl061->irq_chip, 0, handle_bad_irq, IRQ_TYPE_NONE); if (ret) { dev_info(&adev->dev, "could not add irqchip\n"); return ret; } - gpiochip_set_chained_irqchip(&pl061->gc, &pl061_irqchip, + gpiochip_set_chained_irqchip(&pl061->gc, &pl061->irq_chip, irq, pl061_irq_handler); amba_set_drvdata(adev, pl061); -- 2.19.1