Skip to contentSkip to conversation

gpio: TODO: add a task for removing MMIO-specific fields from gpio_chip

PATCH Applied Bartosz Golaszewski 2 participants 3 messages May 27, 2025 – Jun 10, 2025 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: TODO: add a task for removing MMIO-specific fields from gpio_chip

From: Bartosz Golaszewski <[email protected]>

Currently for CONFIG_GPIO_GENERIC=y each struct gpio_chip object contains the fields relevant only for gpio-mmio users. It's not an insignificant number either as it's several pointers and integers.

It makes sense to remove these fields from struct gpio_chip into a dedicated structure but this is not trivial due to how the bgpio_init() function is implemented.

Add a task for tracking this rework.

---
 drivers/gpio/TODO | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpio/TODO +5 -0
index 4a8b349f2483a..ef53892cb44d7 100644
@@ -131,6 +131,11 @@ Work items:
   helpers (x86 inb()/outb()) and convert port-mapped I/O drivers to use
   this with dry-coding and sending to maintainers to test
 
+- Move the MMIO GPIO specific fields out of struct gpio_chip into a
+  dedicated structure. Currently every GPIO chip has them if gpio-mmio is
+  enabled in Kconfig even if it itself doesn't register with the helper
+  library.
+
 -------------------------------------------------------------------------------
 
 Generic regmap GPIO
Signature · 1 line
2.48.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Currently for CONFIG_GPIO_GENERIC=y each struct gpio_chip object contains the fields relevant only for gpio-mmio users. It's not an insignificant number either as it's several pointers and integers.

Quoted 7 lines

It makes sense to remove these fields from struct gpio_chip into a dedicated structure but this is not trivial due to how the bgpio_init() function is implemented.

Add a task for tracking this rework.

That's a good TODO.

Yours,
Linus Walleij

author Applied
#2 lore raw
In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Quoted 9 lines · Bartosz Golaszewski

Currently for CONFIG_GPIO_GENERIC=y each struct gpio_chip object contains the fields relevant only for gpio-mmio users. It's not an insignificant number either as it's several pointers and integers.

It makes sense to remove these fields from struct gpio_chip into a dedicated structure but this is not trivial due to how the bgpio_init() function is implemented.

[...]

Applied, thanks!

[1/1] gpio: TODO: add a task for removing MMIO-specific fields from gpio_chip

      https://git.kernel.org/brgl/linux/c/97a7ea2b8f4a9aec1f43435658343e046c2a4983

Best regards,

Signature · 1 line
Bartosz Golaszewski <[email protected]>