bmips: backport accepted pinctrl patches
[openwrt/staging/dedeckeh.git] / target / linux / bmips / patches-5.10 / 052-v5.13-gpio-guard-gpiochip_irqchip_add_domain-with-GPIOLIB_.patch
1 From 9c7d24693d864f90b27aad5d15fbfe226c02898b Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
3 Date: Wed, 24 Mar 2021 09:19:02 +0100
4 Subject: [PATCH 01/22] gpio: guard gpiochip_irqchip_add_domain() with
5 GPIOLIB_IRQCHIP
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 The current code doesn't check if GPIOLIB_IRQCHIP is enabled, which results in
11 a compilation error when trying to build gpio-regmap if CONFIG_GPIOLIB_IRQCHIP
12 isn't enabled.
13
14 Fixes: 6a45b0e2589f ("gpiolib: Introduce gpiochip_irqchip_add_domain()")
15 Suggested-by: Michael Walle <michael@walle.cc>
16 Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
17 Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
18 Reviewed-by: Michael Walle <michael@walle.cc>
19 Acked-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
20 Link: https://lore.kernel.org/r/20210324081923.20379-2-noltari@gmail.com
21 Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
22 ---
23 include/linux/gpio/driver.h | 9 +++++++++
24 1 file changed, 9 insertions(+)
25
26 --- a/include/linux/gpio/driver.h
27 +++ b/include/linux/gpio/driver.h
28 @@ -637,8 +637,17 @@ int gpiochip_irqchip_add_key(struct gpio
29 bool gpiochip_irqchip_irq_valid(const struct gpio_chip *gc,
30 unsigned int offset);
31
32 +#ifdef CONFIG_GPIOLIB_IRQCHIP
33 int gpiochip_irqchip_add_domain(struct gpio_chip *gc,
34 struct irq_domain *domain);
35 +#else
36 +static inline int gpiochip_irqchip_add_domain(struct gpio_chip *gc,
37 + struct irq_domain *domain)
38 +{
39 + WARN_ON(1);
40 + return -EINVAL;
41 +}
42 +#endif
43
44 #ifdef CONFIG_LOCKDEP
45