gpiolib: Deduplicate forward declaration in the consumer.h header
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 3 Aug 2021 17:39:25 +0000 (20:39 +0300)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 11 Aug 2021 12:54:11 +0000 (15:54 +0300)
struct acpi_device is repeated in two branches of ifdeffery.
Move it out and hence deduplicate.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
include/linux/gpio/consumer.h

index 566feb5..414b8f9 100644 (file)
@@ -680,10 +680,10 @@ struct acpi_gpio_mapping {
        unsigned int quirks;
 };
 
-#if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_ACPI)
-
 struct acpi_device;
 
+#if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_ACPI)
+
 int acpi_dev_add_driver_gpios(struct acpi_device *adev,
                              const struct acpi_gpio_mapping *gpios);
 void acpi_dev_remove_driver_gpios(struct acpi_device *adev);
@@ -696,8 +696,6 @@ struct gpio_desc *acpi_get_and_request_gpiod(char *path, int pin, char *label);
 
 #else  /* CONFIG_GPIOLIB && CONFIG_ACPI */
 
-struct acpi_device;
-
 static inline int acpi_dev_add_driver_gpios(struct acpi_device *adev,
                              const struct acpi_gpio_mapping *gpios)
 {