[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <265ad883fee30b799fd53954876dc567@walle.cc>
Date:   Thu, 04 Mar 2021 09:29:05 +0100
From:   Michael Walle <michael@...le.cc>
To:     Álvaro Fernández Rojas <noltari@...il.com>
Cc:     Linus Walleij <linus.walleij@...aro.org>,
        Bartosz Golaszewski <bgolaszewski@...libre.com>,
        Andy Shevchenko <andy.shevchenko@...il.com>,
        linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] gpio: regmap: disable IRQ domain without GPIOLIB_IRQCHIP
Am 2021-03-04 08:05, schrieb Álvaro Fernández Rojas:
> The current code doesn't check if GPIOLIB_IRQCHIP is enabled, which 
> results in
> a compilation error when trying to build gpio-regmap without having 
> selected
> CONFIG_GPIOLIB_IRQCHIP.
> 
> Fixes: ebe363197e52 ("gpio: add a reusable generic gpio_chip using 
> regmap")
> Signed-off-by: Álvaro Fernández Rojas <noltari@...il.com>
Nice catch.
However, instead of having that ifdef, commit 6a45b0e2589f ("gpiolib:
Introduce gpiochip_irqchip_add_domain()") could be fixed. That one is
missing a stub if CONFIG_GPIOLIB_IRQCHIP is not defined.
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -624,8 +624,16 @@ void gpiochip_irq_domain_deactivate(struct 
irq_domain *domain,
  bool gpiochip_irqchip_irq_valid(const struct gpio_chip *gc,
                                 unsigned int offset);
+#ifdef CONFIG_GPIOLIB_IRQCHIP
  int gpiochip_irqchip_add_domain(struct gpio_chip *gc,
                                 struct irq_domain *domain);
+#else
+static inline int gpiochip_irqchip_add_domain(struct gpio_chip *gc,
+                                             struct irq_domain *domain)
+{
+       return 0;
+}
+#endif /* CONFIG_GPIOLIB_IRQCHIP */
Linus, do you agree?
-michael
Powered by blists - more mailing lists
 
