Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Linus Walleij and committed by
Greg Kroah-Hartman
8750d02d 50b2677c

+10 -9
+10 -9
drivers/staging/greybus/gpio.c
··· 504 504 struct gb_connection *connection; 505 505 struct gb_gpio_controller *ggc; 506 506 struct gpio_chip *gpio; 507 + struct gpio_irq_chip *girq; 507 508 struct irq_chip *irqc; 508 509 int ret; 509 510 ··· 562 561 gpio->ngpio = ggc->line_max + 1; 563 562 gpio->can_sleep = true; 564 563 564 + girq = &gpio->irq; 565 + girq->chip = irqc; 566 + /* The event comes from the outside so no parent handler */ 567 + girq->parent_handler = NULL; 568 + girq->num_parents = 0; 569 + girq->parents = NULL; 570 + girq->default_type = IRQ_TYPE_NONE; 571 + girq->handler = handle_level_irq; 572 + 565 573 ret = gb_connection_enable(connection); 566 574 if (ret) 567 575 goto exit_line_free; ··· 581 571 goto exit_line_free; 582 572 } 583 573 584 - ret = gpiochip_irqchip_add(gpio, irqc, 0, handle_level_irq, 585 - IRQ_TYPE_NONE); 586 - if (ret) { 587 - dev_err(&gbphy_dev->dev, "failed to add irq chip: %d\n", ret); 588 - goto exit_gpiochip_remove; 589 - } 590 - 591 574 gbphy_runtime_put_autosuspend(gbphy_dev); 592 575 return 0; 593 576 594 - exit_gpiochip_remove: 595 - gpiochip_remove(gpio); 596 577 exit_line_free: 597 578 kfree(ggc->lines); 598 579 exit_connection_disable: