Skip to contentSkip to conversation

arm: Select GPIO_GENERIC_PLATFORM for CRAGG_6410

PATCH In review Guenter Roeck 3 participants 5 messages Jan 11, 2016 – Jan 14, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: Select GPIO_GENERIC_PLATFORM for CRAGG_6410

Since commit 0f4630f3720e ("gpio: generic: factor into gpio_chip struct"), all users of struct bgpio_pdata depend on GPIO_GENERIC.

This results in the following build error.

arch/arm/mach-s3c64xx/mach-crag6410.c:270:3: warning:
excess elements in struct initializer
arch/arm/mach-s3c64xx/mach-crag6410.c:270:3: warning:
(near initialization for '(anonymous)')
arch/arm/mach-s3c64xx/mach-crag6410.c:271:2: error:
invalid use of undefined type 'struct bgpio_pdata'

Fixes 0f4630f3720e ("gpio: generic: factor into gpio_chip struct")
Cc Linus Walleij <[email protected]>

---
I don't know if this is the correct way to fix this problem. If not, please consider this to be a bug report.

 arch/arm/mach-s3c64xx/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-s3c64xx/Kconfig +1 -0
index 7c0c420c3016..98d2aa9393f1 100644
@@ -310,6 +310,7 @@ config MACH_WLF_CRAGG_6410
 	depends on I2C=y
 	select CPU_S3C6410
 	select LEDS_GPIO_REGISTER
+	select GPIO_GENERIC_PLATFORM
 	select S3C64XX_DEV_SPI0
 	select S3C64XX_SETUP_FB_24BPP
 	select S3C64XX_SETUP_I2C1
Signature · 1 line
2.1.4
#1 lore raw
Quoted 15 lines · Guenter Roeck

Since commit 0f4630f3720e ("gpio: generic: factor into gpio_chip struct"), all users of struct bgpio_pdata depend on GPIO_GENERIC.

This results in the following build error.

arch/arm/mach-s3c64xx/mach-crag6410.c:270:3: warning:
excess elements in struct initializer
arch/arm/mach-s3c64xx/mach-crag6410.c:270:3: warning:
(near initialization for '(anonymous)')
arch/arm/mach-s3c64xx/mach-crag6410.c:271:2: error:
invalid use of undefined type 'struct bgpio_pdata'

Fixes 0f4630f3720e ("gpio: generic: factor into gpio_chip struct")
Cc Linus Walleij <[email protected]>
Quoted 7 lines

---
I don't know if this is the correct way to fix this problem. If not, please consider this to be a bug report.

 arch/arm/mach-s3c64xx/Kconfig | 1 +
 1 file changed, 1 insertion(+)

Thanks for the report! I think that:

1. Other boards using the bgpio_pdata might be also affected:
mach-clps711x/board-autcpu12.c mach-clps711x/board-p720t.c
mach-imx/mach-mx21ads.c

2. The boards does not directly depend on the GPIO_GENERIC. If GPIO_GENERIC is not selected then it still might create a basic-mmio-gpio device. The device of course won't be in such case supported by any driver.

Instead to solve the error the structure should be always visible so:

-- >8 --
From: Krzysztof Kozlowski <[email protected]>
Date: Tue, 12 Jan 2016 09:46:06 +0900
Subject: [PATCH] gpio: generic: Fix build error of missing bgpio_pdata
declaration

Commit 0f4630f3720e ("gpio: generic: factor into gpio_chip struct") introduced struct bgpio_pdata along with users but made the declaration hidden by CONFIG_GPIO_GENERIC.

This results in the following build error:

arch/arm/mach-s3c64xx/mach-crag6410.c:270:3: warning: excess elements in struct initializer
arch/arm/mach-s3c64xx/mach-crag6410.c:270:3: warning: (near initialization for '(anonymous)')
arch/arm/mach-s3c64xx/mach-crag6410.c:271:2: error: invalid use of undefined type 'struct bgpio_pdata'

Fixes 0f4630f3720e ("gpio: generic: factor into gpio_chip struct")
---
 include/linux/gpio/driver.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
include/linux/gpio/driver.h +1 -2
index e2d05fd0e6e3..7b9054366e7a 100644
@@ -220,14 +220,13 @@ 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,
Signature · 1 line
1.9.1
author Tested-by
#2 lore raw
Quoted 51 lines · Krzysztof Kozlowski
Quoted 15 lines · Guenter Roeck

Since commit 0f4630f3720e ("gpio: generic: factor into gpio_chip struct"), all users of struct bgpio_pdata depend on GPIO_GENERIC.

This results in the following build error.

arch/arm/mach-s3c64xx/mach-crag6410.c:270:3: warning:
excess elements in struct initializer
arch/arm/mach-s3c64xx/mach-crag6410.c:270:3: warning:
(near initialization for '(anonymous)')
arch/arm/mach-s3c64xx/mach-crag6410.c:271:2: error:
invalid use of undefined type 'struct bgpio_pdata'

Fixes 0f4630f3720e ("gpio: generic: factor into gpio_chip struct")
Cc Linus Walleij <[email protected]>
Quoted 7 lines

---
I don't know if this is the correct way to fix this problem. If not, please consider this to be a bug report.

  arch/arm/mach-s3c64xx/Kconfig | 1 +
  1 file changed, 1 insertion(+)

Thanks for the report! I think that:

1. Other boards using the bgpio_pdata might be also affected:
mach-clps711x/board-autcpu12.c mach-clps711x/board-p720t.c
mach-imx/mach-mx21ads.c

2. The boards does not directly depend on the GPIO_GENERIC. If GPIO_GENERIC is not selected then it still might create a basic-mmio-gpio device. The device of course won't be in such case supported by any driver.

Instead to solve the error the structure should be always visible so:

-- >8 --
From: Krzysztof Kozlowski <[email protected]>
Date: Tue, 12 Jan 2016 09:46:06 +0900
Subject: [PATCH] gpio: generic: Fix build error of missing bgpio_pdata
declaration

Commit 0f4630f3720e ("gpio: generic: factor into gpio_chip struct") introduced struct bgpio_pdata along with users but made the declaration hidden by CONFIG_GPIO_GENERIC.

Quoted 8 lines

This results in the following build error:

arch/arm/mach-s3c64xx/mach-crag6410.c:270:3: warning: excess elements in struct initializer
arch/arm/mach-s3c64xx/mach-crag6410.c:270:3: warning: (near initialization for '(anonymous)')
arch/arm/mach-s3c64xx/mach-crag6410.c:271:2: error: invalid use of undefined type 'struct bgpio_pdata'

Fixes 0f4630f3720e ("gpio: generic: factor into gpio_chip struct")
Quoted 26 lines
---
  include/linux/gpio/driver.h | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
include/linux/gpio/driver.h +1 -2
index e2d05fd0e6e3..7b9054366e7a 100644
@@ -220,14 +220,13 @@ 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,
#3 lore raw
In reply to Guenter Roeck
Quoted 12 lines · Guenter Roeck

Since commit 0f4630f3720e ("gpio: generic: factor into gpio_chip struct"), all users of struct bgpio_pdata depend on GPIO_GENERIC.

This results in the following build error.

arch/arm/mach-s3c64xx/mach-crag6410.c:270:3: warning:
excess elements in struct initializer
arch/arm/mach-s3c64xx/mach-crag6410.c:270:3: warning:
(near initialization for '(anonymous)')
arch/arm/mach-s3c64xx/mach-crag6410.c:271:2: error:
invalid use of undefined type 'struct bgpio_pdata'

Quoted 6 lines
Fixes 0f4630f3720e ("gpio: generic: factor into gpio_chip struct")
Cc Linus Walleij <[email protected]>

---
I don't know if this is the correct way to fix this problem. If not, please consider this to be a bug report.

I think this is fixed by Arnds patch:
http://marc.info/?l=linux-gpio&m=145237423205247&w=2

Can you verify that?

Yours,
Linus Walleij

#4 lore raw
Quoted 21 lines · Linus Walleij
Quoted 12 lines · Guenter Roeck

Since commit 0f4630f3720e ("gpio: generic: factor into gpio_chip struct"), all users of struct bgpio_pdata depend on GPIO_GENERIC.

This results in the following build error.

arch/arm/mach-s3c64xx/mach-crag6410.c:270:3: warning:
excess elements in struct initializer
arch/arm/mach-s3c64xx/mach-crag6410.c:270:3: warning:
(near initialization for '(anonymous)')
arch/arm/mach-s3c64xx/mach-crag6410.c:271:2: error:
invalid use of undefined type 'struct bgpio_pdata'

Quoted 6 lines
Fixes 0f4630f3720e ("gpio: generic: factor into gpio_chip struct")
Cc Linus Walleij <[email protected]>

---
I don't know if this is the correct way to fix this problem. If not, please consider this to be a bug report.

Quoted 5 lines

I think this is fixed by Arnds patch:
http://marc.info/?l=linux-gpio&m=145237423205247&w=2

Can you verify that?

Correct.

Guenter