Skip to content

Commit b390752

Browse files
committed
gpiolib: Deduplicate forward declaration in the consumer.h header
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>
1 parent 40bb0e3 commit b390752

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎include/linux/gpio/consumer.h‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -680,10 +680,10 @@ struct acpi_gpio_mapping {
680680
unsigned int quirks;
681681
};
682682

683-
#if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_ACPI)
684-
685683
struct acpi_device;
686684

685+
#if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_ACPI)
686+
687687
int acpi_dev_add_driver_gpios(struct acpi_device *adev,
688688
const struct acpi_gpio_mapping *gpios);
689689
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);
696696

697697
#else /* CONFIG_GPIOLIB && CONFIG_ACPI */
698698

699-
struct acpi_device;
700-
701699
static inline int acpi_dev_add_driver_gpios(struct acpi_device *adev,
702700
const struct acpi_gpio_mapping *gpios)
703701
{

0 commit comments

Comments
 (0)