Skip to content

Commit afb3416

Browse files
Noltarigregkh
authored andcommitted
gpio: guard gpiochip_irqchip_add_domain() with GPIOLIB_IRQCHIP
[ Upstream commit 9c7d246 ] The current code doesn't check if GPIOLIB_IRQCHIP is enabled, which results in a compilation error when trying to build gpio-regmap if CONFIG_GPIOLIB_IRQCHIP isn't enabled. Fixes: 6a45b0e ("gpiolib: Introduce gpiochip_irqchip_add_domain()") Suggested-by: Michael Walle <michael@walle.cc> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Michael Walle <michael@walle.cc> Acked-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Link: https://lore.kernel.org/r/20210324081923.20379-2-noltari@gmail.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 9becf95 commit afb3416

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎include/linux/gpio/driver.h‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,8 +637,17 @@ int gpiochip_irqchip_add_key(struct gpio_chip *gc,
637637
bool gpiochip_irqchip_irq_valid(const struct gpio_chip *gc,
638638
unsigned int offset);
639639

640+
#ifdef CONFIG_GPIOLIB_IRQCHIP
640641
int gpiochip_irqchip_add_domain(struct gpio_chip *gc,
641642
struct irq_domain *domain);
643+
#else
644+
static inline int gpiochip_irqchip_add_domain(struct gpio_chip *gc,
645+
struct irq_domain *domain)
646+
{
647+
WARN_ON(1);
648+
return -EINVAL;
649+
}
650+
#endif
642651

643652
#ifdef CONFIG_LOCKDEP
644653

0 commit comments

Comments
 (0)