mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] gpio: Fix unused variable warning
@ 2023-01-25  8:09 Sascha Hauer
  2023-01-25  9:13 ` Marco Felsch
  0 siblings, 1 reply; 2+ messages in thread
From: Sascha Hauer @ 2023-01-25  8:09 UTC (permalink / raw)
  To: Barebox List

gpio_suffixes is only used inside #ifdef CONFIG_OFDEVICE, so put
it into this ifdef as well.

Fixes: 9fb2fa240d58 ("gpiolib: implement dev_gpiod_get_index")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/gpio/gpiolib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 4e8244b25f..2e7a39b475 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -537,12 +537,12 @@ static int of_gpiochip_scan_hogs(struct gpio_chip *chip)
 	return 0;
 }
 
+#ifdef CONFIG_OFDEVICE
 static const char *gpio_suffixes[] = {
 	"gpios",
 	"gpio",
 };
 
-#ifdef CONFIG_OFDEVICE
 /* Linux compatibility helper: Get a GPIO descriptor from device tree */
 int dev_gpiod_get_index(struct device *dev,
 			struct device_node *np,
-- 
2.30.2




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] gpio: Fix unused variable warning
  2023-01-25  8:09 [PATCH] gpio: Fix unused variable warning Sascha Hauer
@ 2023-01-25  9:13 ` Marco Felsch
  0 siblings, 0 replies; 2+ messages in thread
From: Marco Felsch @ 2023-01-25  9:13 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: Barebox List

On 23-01-25, Sascha Hauer wrote:
> gpio_suffixes is only used inside #ifdef CONFIG_OFDEVICE, so put
> it into this ifdef as well.
> 
> Fixes: 9fb2fa240d58 ("gpiolib: implement dev_gpiod_get_index")
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>

> ---
>  drivers/gpio/gpiolib.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
> index 4e8244b25f..2e7a39b475 100644
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -537,12 +537,12 @@ static int of_gpiochip_scan_hogs(struct gpio_chip *chip)
>  	return 0;
>  }
>  
> +#ifdef CONFIG_OFDEVICE
>  static const char *gpio_suffixes[] = {
>  	"gpios",
>  	"gpio",
>  };
>  
> -#ifdef CONFIG_OFDEVICE
>  /* Linux compatibility helper: Get a GPIO descriptor from device tree */
>  int dev_gpiod_get_index(struct device *dev,
>  			struct device_node *np,
> -- 
> 2.30.2
> 
> 
> 



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-25  9:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-25  8:09 [PATCH] gpio: Fix unused variable warning Sascha Hauer
2023-01-25  9:13 ` Marco Felsch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox