Thread (572 messages) flat view 572 messages, 20 authors, 2021-05-25
STALE1933d REVIEWED: 3 (0M)

3 review trailers.

[PATCH 5.10 377/530] gpio: guard gpiochip_irqchip_add_domain() with GPIOLIB_IRQCHIP

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2021-05-12 16:19:40
Also in: lkml
Subsystem: gpio subsystem, the rest · Maintainers: Linus Walleij, Bartosz Golaszewski, Linus Torvalds

From: Álvaro Fernández Rojas <redacted>

[ Upstream commit 9c7d24693d864f90b27aad5d15fbfe226c02898b ]

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: 6a45b0e2589f ("gpiolib: Introduce gpiochip_irqchip_add_domain()")
Suggested-by: Michael Walle <redacted>
Signed-off-by: Álvaro Fernández Rojas <redacted>
Reviewed-by: Linus Walleij <redacted>
Reviewed-by: Michael Walle <redacted>
Acked-by: Bartosz Golaszewski <redacted>
Link: https://lore.kernel.org/r/20210324081923.20379-2-noltari@gmail.com (local)
Signed-off-by: Linus Walleij <redacted>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/linux/gpio/driver.h | 9 +++++++++
 1 file changed, 9 insertions(+)
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index 4a7e295c3640..8e144306e262 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -637,8 +637,17 @@ int gpiochip_irqchip_add_key(struct gpio_chip *gc,
 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)
+{
+	WARN_ON(1);
+	return -EINVAL;
+}
+#endif
 
 #ifdef CONFIG_LOCKDEP
 
-- 
2.30.2


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help