Commit e92c1e9a authored by Andrey Smirnov's avatar Andrey Smirnov Committed by Greg Kroah-Hartman

gpio: vf610: Do not share irq_chip

[ Upstream commit 338aa107 ]

Fix the warning produced by gpiochip_set_irq_hooks() by allocating a
dedicated IRQ chip per GPIO chip/port.
Signed-off-by: default avatarAndrey Smirnov <andrew.smirnov@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Cc: Chris Healy <cphealy@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: linux-gpio@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-imx@nxp.com
Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 718910bf
...@@ -29,6 +29,7 @@ struct fsl_gpio_soc_data { ...@@ -29,6 +29,7 @@ struct fsl_gpio_soc_data {
struct vf610_gpio_port { struct vf610_gpio_port {
struct gpio_chip gc; struct gpio_chip gc;
struct irq_chip ic;
void __iomem *base; void __iomem *base;
void __iomem *gpio_base; void __iomem *gpio_base;
const struct fsl_gpio_soc_data *sdata; const struct fsl_gpio_soc_data *sdata;
...@@ -60,8 +61,6 @@ struct vf610_gpio_port { ...@@ -60,8 +61,6 @@ struct vf610_gpio_port {
#define PORT_INT_EITHER_EDGE 0xb #define PORT_INT_EITHER_EDGE 0xb
#define PORT_INT_LOGIC_ONE 0xc #define PORT_INT_LOGIC_ONE 0xc
static struct irq_chip vf610_gpio_irq_chip;
static const struct fsl_gpio_soc_data imx_data = { static const struct fsl_gpio_soc_data imx_data = {
.have_paddr = true, .have_paddr = true,
}; };
...@@ -237,15 +236,6 @@ static int vf610_gpio_irq_set_wake(struct irq_data *d, u32 enable) ...@@ -237,15 +236,6 @@ static int vf610_gpio_irq_set_wake(struct irq_data *d, u32 enable)
return 0; 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) static int vf610_gpio_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
...@@ -253,6 +243,7 @@ static int vf610_gpio_probe(struct platform_device *pdev) ...@@ -253,6 +243,7 @@ static int vf610_gpio_probe(struct platform_device *pdev)
struct vf610_gpio_port *port; struct vf610_gpio_port *port;
struct resource *iores; struct resource *iores;
struct gpio_chip *gc; struct gpio_chip *gc;
struct irq_chip *ic;
int i; int i;
int ret; int ret;
...@@ -316,6 +307,14 @@ static int vf610_gpio_probe(struct platform_device *pdev) ...@@ -316,6 +307,14 @@ static int vf610_gpio_probe(struct platform_device *pdev)
gc->direction_output = vf610_gpio_direction_output; gc->direction_output = vf610_gpio_direction_output;
gc->set = vf610_gpio_set; 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); ret = gpiochip_add_data(gc, port);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -327,14 +326,13 @@ static int vf610_gpio_probe(struct platform_device *pdev) ...@@ -327,14 +326,13 @@ static int vf610_gpio_probe(struct platform_device *pdev)
/* Clear the interrupt status register for all GPIO's */ /* Clear the interrupt status register for all GPIO's */
vf610_gpio_writel(~0, port->base + PORT_ISFR); vf610_gpio_writel(~0, port->base + PORT_ISFR);
ret = gpiochip_irqchip_add(gc, &vf610_gpio_irq_chip, 0, ret = gpiochip_irqchip_add(gc, ic, 0, handle_edge_irq, IRQ_TYPE_NONE);
handle_edge_irq, IRQ_TYPE_NONE);
if (ret) { if (ret) {
dev_err(dev, "failed to add irqchip\n"); dev_err(dev, "failed to add irqchip\n");
gpiochip_remove(gc); gpiochip_remove(gc);
return ret; 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); vf610_gpio_irq_handler);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment