diff mbox series

[1/2] gpio: sysfs: fix forward declaration of struct gpio_device

Message ID 20231127193716.63143-1-brgl@bgdev.pl
State New
Headers show
Series [1/2] gpio: sysfs: fix forward declaration of struct gpio_device | expand

Commit Message

Bartosz Golaszewski Nov. 27, 2023, 7:37 p.m. UTC
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

The forward declaration for struct gpio_device should be provided for
both branches of the #ifdef.

Fixes: 08a149c40bdb ("gpiolib: Clean up headers")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 drivers/gpio/gpiolib-sysfs.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Bartosz Golaszewski Nov. 28, 2023, 4:45 p.m. UTC | #1
On Mon, Nov 27, 2023 at 8:37 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> The forward declaration for struct gpio_device should be provided for
> both branches of the #ifdef.
>
> Fixes: 08a149c40bdb ("gpiolib: Clean up headers")
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> ---
>  drivers/gpio/gpiolib-sysfs.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpio/gpiolib-sysfs.h b/drivers/gpio/gpiolib-sysfs.h
> index 0f213bdb4732..b794b396d6a5 100644
> --- a/drivers/gpio/gpiolib-sysfs.h
> +++ b/drivers/gpio/gpiolib-sysfs.h
> @@ -3,10 +3,10 @@
>  #ifndef GPIOLIB_SYSFS_H
>  #define GPIOLIB_SYSFS_H
>
> -#ifdef CONFIG_GPIO_SYSFS
> -
>  struct gpio_device;
>
> +#ifdef CONFIG_GPIO_SYSFS
> +
>  int gpiochip_sysfs_register(struct gpio_device *gdev);
>  void gpiochip_sysfs_unregister(struct gpio_device *gdev);
>
> --
> 2.40.1
>

I applied this. I'll make patch 2/2 part of the upcoming locking rework.

Bart
diff mbox series

Patch

diff --git a/drivers/gpio/gpiolib-sysfs.h b/drivers/gpio/gpiolib-sysfs.h
index 0f213bdb4732..b794b396d6a5 100644
--- a/drivers/gpio/gpiolib-sysfs.h
+++ b/drivers/gpio/gpiolib-sysfs.h
@@ -3,10 +3,10 @@ 
 #ifndef GPIOLIB_SYSFS_H
 #define GPIOLIB_SYSFS_H
 
-#ifdef CONFIG_GPIO_SYSFS
-
 struct gpio_device;
 
+#ifdef CONFIG_GPIO_SYSFS
+
 int gpiochip_sysfs_register(struct gpio_device *gdev);
 void gpiochip_sysfs_unregister(struct gpio_device *gdev);