summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2020-07-22 10:44:14 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-07-28 11:05:33 +0300
commit8750d02d1acebcb472673399b7315b0f74f5b3cf (patch)
tree93810baa66810226003eaa6f5d9fd735c270d6ba /drivers/staging/greybus
parent50b2677c4e276771a6383382929180b1589b835f (diff)
downloadlinux-8750d02d1acebcb472673399b7315b0f74f5b3cf.tar.xz
staging: greybus: gpio: Use irqchip template
This makes the driver use the irqchip template to assign properties to the gpio_irq_chip instead of using the explicit calls to gpiochip_irqchip_add(). The irqchip is instead added while adding the gpiochip. Cc: Nishad Kamdar <nishadkamdar@gmail.com> Cc: Johan Hovold <johan@kernel.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20200722074414.48457-1-linus.walleij@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/greybus')
-rw-r--r--drivers/staging/greybus/gpio.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/staging/greybus/gpio.c b/drivers/staging/greybus/gpio.c
index 36d99f9e419e..7e6347fe93f9 100644
--- a/drivers/staging/greybus/gpio.c
+++ b/drivers/staging/greybus/gpio.c
@@ -504,6 +504,7 @@ static int gb_gpio_probe(struct gbphy_device *gbphy_dev,
struct gb_connection *connection;
struct gb_gpio_controller *ggc;
struct gpio_chip *gpio;
+ struct gpio_irq_chip *girq;
struct irq_chip *irqc;
int ret;
@@ -561,6 +562,15 @@ static int gb_gpio_probe(struct gbphy_device *gbphy_dev,
gpio->ngpio = ggc->line_max + 1;
gpio->can_sleep = true;
+ girq = &gpio->irq;
+ girq->chip = irqc;
+ /* The event comes from the outside so no parent handler */
+ girq->parent_handler = NULL;
+ girq->num_parents = 0;
+ girq->parents = NULL;
+ girq->default_type = IRQ_TYPE_NONE;
+ girq->handler = handle_level_irq;
+
ret = gb_connection_enable(connection);
if (ret)
goto exit_line_free;
@@ -571,18 +581,9 @@ static int gb_gpio_probe(struct gbphy_device *gbphy_dev,
goto exit_line_free;
}
- ret = gpiochip_irqchip_add(gpio, irqc, 0, handle_level_irq,
- IRQ_TYPE_NONE);
- if (ret) {
- dev_err(&gbphy_dev->dev, "failed to add irq chip: %d\n", ret);
- goto exit_gpiochip_remove;
- }
-
gbphy_runtime_put_autosuspend(gbphy_dev);
return 0;
-exit_gpiochip_remove:
- gpiochip_remove(gpio);
exit_line_free:
kfree(ggc->lines);
exit_connection_disable: