gpio: generic: make bgpio_pdata always visible
PATCH 1/1 gpio: generic: make bgpio_pdata always visible
Board files that define their own bgpio_pdata are broken when CONFIG_GPIO_GENERIC is disabled and the bgpio_pdata structure definition is hidden by the #ifdef:
arch/arm/mach-clps711x/board-autcpu12.c:148:15: error: variable 'autcpu12_mmgpio_pdata' has initializer but incomplete type
static struct bgpio_pdata autcpu12_mmgpio_pdata __initdata = {arch/arm/mach-clps711x/board-autcpu12.c:149:2: error: unknown field 'base' specified in initializer
.base = AUTCPU12_MMGPIO_BASE,
Since the board files should generally not care what drivers are enabled, this makes the structure definition visible again.
include/linux/gpio/driver.h +2 -2
@@ -220,14 +220,14 @@ static inline void *gpiochip_get_data(struct gpio_chip *chip)struct gpio_chip *gpiod_to_chip (const struct gpio_desc *desc); -#if IS_ENABLED (CONFIG_GPIO_GENERIC ) -struct bgpio_pdata {const char *label;int base;int ngpio; }; +#if IS_ENABLED (CONFIG_GPIO_GENERIC ) + int bgpio_init(struct gpio_chip *gc, struct device *dev, unsigned long sz, void __iomem *dat, void __iomem *set, void __iomem *clr, void __iomem *dirout, void __iomem *dirin,
Quoted 9 lines · Arnd Bergmann
Board files that define their own
bgpio_pdataare broken whenCONFIG_GPIO_GENERICis disabled and thebgpio_pdatastructure definition is hidden by the #ifdef:
arch/arm/mach-clps711x/board-autcpu12.c:148:15: error: variable 'autcpu12_mmgpio_pdata' has initializer but incomplete type
static structbgpio_pdataautcpu12_mmgpio_pdata__initdata= {arch/arm/mach-clps711x/board-autcpu12.c:149:2: error: unknown field 'base' specified in initializer
.base =AUTCPU12_MMGPIO_BASE,
Quoted 5 lines
Since the board files should generally not care what drivers are enabled, this makes the structure definition visible again.
Signed-off-by Arnd Bergmann <[email protected]>Fixes 0f4630f3720e ("gpio: generic: factor into gpio_chip struct")
Thanks a lot, patch applied!
Yours,
Linus Walleij