summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-siox.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2019-06-25 12:36:12 +0200
committerLinus Walleij <linus.walleij@linaro.org>2019-07-03 10:23:24 +0200
commitb25e10f8f9bcec3396d2f4348844cc28f06d772f (patch)
treee53e7308794fd977b43b6b2583e775675e54cd60 /drivers/gpio/gpio-siox.c
parent87b70378f424df65465d5bfba2b8f233ee8b36e7 (diff)
gpio: siox: Pass irqchip when adding gpiochip
We need to convert all old gpio irqchips to pass the irqchip setup along when adding the gpio_chip. For chained irqchips this is a pretty straight-forward conversion. Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Cc: Thierry Reding <treding@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-siox.c')
-rw-r--r--drivers/gpio/gpio-siox.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/gpio/gpio-siox.c b/drivers/gpio/gpio-siox.c
index 40067e1535d3..26a0ecd487cb 100644
--- a/drivers/gpio/gpio-siox.c
+++ b/drivers/gpio/gpio-siox.c
@@ -211,6 +211,7 @@ static int gpio_siox_get_direction(struct gpio_chip *chip, unsigned int offset)
static int gpio_siox_probe(struct siox_device *sdevice)
{
struct gpio_siox_ddata *ddata;
+ struct gpio_irq_chip *girq;
int ret;
ddata = devm_kzalloc(&sdevice->dev, sizeof(*ddata), GFP_KERNEL);
@@ -239,18 +240,15 @@ static int gpio_siox_probe(struct siox_device *sdevice)
ddata->ichip.irq_unmask = gpio_siox_irq_unmask;
ddata->ichip.irq_set_type = gpio_siox_irq_set_type;
- ret = gpiochip_add(&ddata->gchip);
- if (ret) {
- dev_err(&sdevice->dev,
- "Failed to register gpio chip (%d)\n", ret);
- return ret;
- }
+ girq = &ddata->gchip.irq;
+ girq->chip = &ddata->ichip;
+ girq->default_type = IRQ_TYPE_NONE;
+ girq->handler = handle_level_irq;
- ret = gpiochip_irqchip_add(&ddata->gchip, &ddata->ichip,
- 0, handle_level_irq, IRQ_TYPE_NONE);
+ ret = gpiochip_add(&ddata->gchip);
if (ret)
dev_err(&sdevice->dev,
- "Failed to register irq chip (%d)\n", ret);
+ "Failed to register gpio chip (%d)\n", ret);
return ret;
}