[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210304070501.30942-1-noltari@gmail.com>
Date: Thu, 4 Mar 2021 08:05:01 +0100
From: Álvaro Fernández Rojas
<noltari@...il.com>
To: Michael Walle <michael@...le.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
Cc: Álvaro Fernández Rojas
<noltari@...il.com>
Subject: [PATCH] gpio: regmap: disable IRQ domain without GPIOLIB_IRQCHIP
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>
---
drivers/gpio/gpio-regmap.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c
index 5412cb3b0b2a..fed1e269c42a 100644
--- a/drivers/gpio/gpio-regmap.c
+++ b/drivers/gpio/gpio-regmap.c
@@ -279,16 +279,20 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config
if (ret < 0)
goto err_free_gpio;
+#ifdef CONFIG_GPIOLIB_IRQCHIP
if (config->irq_domain) {
ret = gpiochip_irqchip_add_domain(chip, config->irq_domain);
if (ret)
goto err_remove_gpiochip;
}
+#endif /* CONFIG_GPIOLIB_IRQCHIP */
return gpio;
+#ifdef CONFIG_GPIOLIB_IRQCHIP
err_remove_gpiochip:
gpiochip_remove(chip);
+#endif /* CONFIG_GPIOLIB_IRQCHIP */
err_free_gpio:
kfree(gpio);
return ERR_PTR(ret);
--
2.20.1
Powered by blists - more mailing lists