]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.19.51/gpio-vf610-do-not-share-irq_chip.patch
Linux 4.19.51
[thirdparty/kernel/stable-queue.git] / releases / 4.19.51 / gpio-vf610-do-not-share-irq_chip.patch
CommitLineData
37554d48
SL
1From 65f6c29a4c5894ae2e3de6d28bb0845e74844fad Mon Sep 17 00:00:00 2001
2From: Andrey Smirnov <andrew.smirnov@gmail.com>
3Date: Sun, 10 Mar 2019 23:27:31 -0700
4Subject: gpio: vf610: Do not share irq_chip
5
6[ Upstream commit 338aa10750ba24d04beeaf5dc5efc032e5cf343f ]
7
8Fix the warning produced by gpiochip_set_irq_hooks() by allocating a
9dedicated IRQ chip per GPIO chip/port.
10
11Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
12Cc: Linus Walleij <linus.walleij@linaro.org>
13Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
14Cc: Chris Healy <cphealy@gmail.com>
15Cc: Andrew Lunn <andrew@lunn.ch>
16Cc: Heiner Kallweit <hkallweit1@gmail.com>
17Cc: Fabio Estevam <festevam@gmail.com>
18Cc: linux-gpio@vger.kernel.org
19Cc: linux-kernel@vger.kernel.org
20Cc: linux-imx@nxp.com
21Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
22Signed-off-by: Sasha Levin <sashal@kernel.org>
23---
24 drivers/gpio/gpio-vf610.c | 26 ++++++++++++--------------
25 1 file changed, 12 insertions(+), 14 deletions(-)
26
27diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c
28index 7e09ce75ffb2..a9cb5571de54 100644
29--- a/drivers/gpio/gpio-vf610.c
30+++ b/drivers/gpio/gpio-vf610.c
31@@ -37,6 +37,7 @@ struct fsl_gpio_soc_data {
32
33 struct vf610_gpio_port {
34 struct gpio_chip gc;
35+ struct irq_chip ic;
36 void __iomem *base;
37 void __iomem *gpio_base;
38 const struct fsl_gpio_soc_data *sdata;
39@@ -66,8 +67,6 @@ struct vf610_gpio_port {
40 #define PORT_INT_EITHER_EDGE 0xb
41 #define PORT_INT_LOGIC_ONE 0xc
42
43-static struct irq_chip vf610_gpio_irq_chip;
44-
45 static const struct fsl_gpio_soc_data imx_data = {
46 .have_paddr = true,
47 };
48@@ -243,15 +242,6 @@ static int vf610_gpio_irq_set_wake(struct irq_data *d, u32 enable)
49 return 0;
50 }
51
52-static struct irq_chip vf610_gpio_irq_chip = {
53- .name = "gpio-vf610",
54- .irq_ack = vf610_gpio_irq_ack,
55- .irq_mask = vf610_gpio_irq_mask,
56- .irq_unmask = vf610_gpio_irq_unmask,
57- .irq_set_type = vf610_gpio_irq_set_type,
58- .irq_set_wake = vf610_gpio_irq_set_wake,
59-};
60-
61 static int vf610_gpio_probe(struct platform_device *pdev)
62 {
63 struct device *dev = &pdev->dev;
64@@ -259,6 +249,7 @@ static int vf610_gpio_probe(struct platform_device *pdev)
65 struct vf610_gpio_port *port;
66 struct resource *iores;
67 struct gpio_chip *gc;
68+ struct irq_chip *ic;
69 int i;
70 int ret;
71
72@@ -295,6 +286,14 @@ static int vf610_gpio_probe(struct platform_device *pdev)
73 gc->direction_output = vf610_gpio_direction_output;
74 gc->set = vf610_gpio_set;
75
76+ ic = &port->ic;
77+ ic->name = "gpio-vf610";
78+ ic->irq_ack = vf610_gpio_irq_ack;
79+ ic->irq_mask = vf610_gpio_irq_mask;
80+ ic->irq_unmask = vf610_gpio_irq_unmask;
81+ ic->irq_set_type = vf610_gpio_irq_set_type;
82+ ic->irq_set_wake = vf610_gpio_irq_set_wake;
83+
84 ret = gpiochip_add_data(gc, port);
85 if (ret < 0)
86 return ret;
87@@ -306,14 +305,13 @@ static int vf610_gpio_probe(struct platform_device *pdev)
88 /* Clear the interrupt status register for all GPIO's */
89 vf610_gpio_writel(~0, port->base + PORT_ISFR);
90
91- ret = gpiochip_irqchip_add(gc, &vf610_gpio_irq_chip, 0,
92- handle_edge_irq, IRQ_TYPE_NONE);
93+ ret = gpiochip_irqchip_add(gc, ic, 0, handle_edge_irq, IRQ_TYPE_NONE);
94 if (ret) {
95 dev_err(dev, "failed to add irqchip\n");
96 gpiochip_remove(gc);
97 return ret;
98 }
99- gpiochip_set_chained_irqchip(gc, &vf610_gpio_irq_chip, port->irq,
100+ gpiochip_set_chained_irqchip(gc, ic, port->irq,
101 vf610_gpio_irq_handler);
102
103 return 0;
104--
1052.20.1
106