2021-03-04 15:45:28

by Álvaro Fernández Rojas

[permalink] [raw]
Subject: [PATCH v4 01/15] gpio: guard gpiochip_irqchip_add_domain() with 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 if CONFIG_GPIOLIB_IRQCHIP
isn't enabled.

Fixes: 6a45b0e2589f ("gpiolib: Introduce gpiochip_irqchip_add_domain()")
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
---
v4: add patch (fix include instead of gpio-regmap.c)

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 286de0520574..ecf0032a0995 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -624,8 +624,17 @@ 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)
+{
+ WARN_ON(1);
+ return -EINVAL;
+}
+#endif

int gpiochip_generic_request(struct gpio_chip *gc, unsigned int offset);
void gpiochip_generic_free(struct gpio_chip *gc, unsigned int offset);
--
2.20.1


2021-03-04 16:26:36

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v4 01/15] gpio: guard gpiochip_irqchip_add_domain() with GPIOLIB_IRQCHIP

On Thu, Mar 4, 2021 at 10:57 AM Álvaro Fernández Rojas
<[email protected]> wrote:
>
> 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.

Suggested-by: ?

> Fixes: 6a45b0e2589f ("gpiolib: Introduce gpiochip_irqchip_add_domain()")
> Signed-off-by: Álvaro Fernández Rojas <[email protected]>
> ---
> v4: add patch (fix include instead of gpio-regmap.c)
>
> 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 286de0520574..ecf0032a0995 100644
> --- a/include/linux/gpio/driver.h
> +++ b/include/linux/gpio/driver.h
> @@ -624,8 +624,17 @@ 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)
> +{
> + WARN_ON(1);
> + return -EINVAL;
> +}
> +#endif
>
> int gpiochip_generic_request(struct gpio_chip *gc, unsigned int offset);
> void gpiochip_generic_free(struct gpio_chip *gc, unsigned int offset);
> --
> 2.20.1
>


--
With Best Regards,
Andy Shevchenko

2021-03-05 00:10:53

by Álvaro Fernández Rojas

[permalink] [raw]
Subject: Re: [PATCH v4 01/15] gpio: guard gpiochip_irqchip_add_domain() with GPIOLIB_IRQCHIP

Add missing tag:

Suggested-by: Michael Walle <[email protected]>

> El 4 mar 2021, a las 9:56, Álvaro Fernández Rojas <[email protected]> escribió:
>
> 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()")
> Signed-off-by: Álvaro Fernández Rojas <[email protected]>
> ---
> v4: add patch (fix include instead of gpio-regmap.c)
>
> 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 286de0520574..ecf0032a0995 100644
> --- a/include/linux/gpio/driver.h
> +++ b/include/linux/gpio/driver.h
> @@ -624,8 +624,17 @@ 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)
> +{
> + WARN_ON(1);
> + return -EINVAL;
> +}
> +#endif
>
> int gpiochip_generic_request(struct gpio_chip *gc, unsigned int offset);
> void gpiochip_generic_free(struct gpio_chip *gc, unsigned int offset);
> --
> 2.20.1
>

2021-03-09 16:23:14

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH v4 01/15] gpio: guard gpiochip_irqchip_add_domain() with GPIOLIB_IRQCHIP

On Thu, Mar 4, 2021 at 9:57 AM Álvaro Fernández Rojas <[email protected]> wrote:

> 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()")
> Signed-off-by: Álvaro Fernández Rojas <[email protected]>

Reviewed-by: Linus Walleij <[email protected]>

Yours,
Linus Walleij