提交 c29e668a 编写于 作者: Á Álvaro Fernández Rojas 提交者: Zheng Zengkai

gpio: guard gpiochip_irqchip_add_domain() with GPIOLIB_IRQCHIP

stable inclusion
from stable-5.10.37
commit afb3416c4fef5c4e18808c9328e01967b2a2a501
bugzilla: 51868
CVE: NA

--------------------------------

[ Upstream commit 9c7d2469 ]

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: 6a45b0e2 ("gpiolib: Introduce gpiochip_irqchip_add_domain()")
Suggested-by: NMichael Walle <michael@walle.cc>
Signed-off-by: NÁlvaro Fernández Rojas <noltari@gmail.com>
Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
Reviewed-by: NMichael Walle <michael@walle.cc>
Acked-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
Link: https://lore.kernel.org/r/20210324081923.20379-2-noltari@gmail.comSigned-off-by: NLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 72b500a7
...@@ -637,8 +637,17 @@ int gpiochip_irqchip_add_key(struct gpio_chip *gc, ...@@ -637,8 +637,17 @@ int gpiochip_irqchip_add_key(struct gpio_chip *gc,
bool gpiochip_irqchip_irq_valid(const struct gpio_chip *gc, bool gpiochip_irqchip_irq_valid(const struct gpio_chip *gc,
unsigned int offset); unsigned int offset);
#ifdef CONFIG_GPIOLIB_IRQCHIP
int gpiochip_irqchip_add_domain(struct gpio_chip *gc, int gpiochip_irqchip_add_domain(struct gpio_chip *gc,
struct irq_domain *domain); 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 #ifdef CONFIG_LOCKDEP
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册