* [PATCH v2 6.6.y] pinctrl: core: include linux/gpio/driver.h
@ 2026-12-05 5:06 pg.radadia
0 siblings, 0 replies; only message in thread
From: pg.radadia @ 2026-12-05 5:06 UTC (permalink / raw)
To: stable; +Cc: linux-gpio, linus.walleij, brgl, pragnesh
From: pragnesh <pg.radadia@gmail.com>
The 6.6.y backport of commit 45d2055b0067 ("pinctrl: remove
pinctrl_gpio_direction_output()") changed pinctrl_gpio_direction_input()
and pinctrl_gpio_direction_output() to take a struct gpio_chip and
access gc->base. Unlike mainline, however, it did not include
<linux/gpio/driver.h>, which is where struct gpio_chip is defined.
drivers/pinctrl/core.c only includes ../gpio/gpiolib.h when
CONFIG_GPIOLIB is enabled, and that header is what used to pull in the
definition of struct gpio_chip. With CONFIG_PINCTRL=y and
CONFIG_GPIOLIB=n the build now fails:
CC drivers/pinctrl/core.o
drivers/pinctrl/core.c: In function 'pinctrl_gpio_direction_input':
drivers/pinctrl/core.c:886:41: error: invalid use of undefined type 'struct gpio_chip'
886 | return pinctrl_gpio_direction(gc->base + offset, true);
| ^~
drivers/pinctrl/core.c: In function 'pinctrl_gpio_direction_output':
drivers/pinctrl/core.c:901:41: error: invalid use of undefined type 'struct gpio_chip'
901 | return pinctrl_gpio_direction(gc->base + offset, false);
| ^~
drivers/pinctrl/core.c:887:1: error: control reaches end of non-void function [-Werror=return-type]
drivers/pinctrl/core.c:902:1: error: control reaches end of non-void function [-Werror=return-type]
Include <linux/gpio/driver.h> unconditionally, matching mainline since
commit ec963d04ca86 ("pinctrl: provide new GPIO-to-pinctrl glue helpers").
The matching prerequisite was not part of the 6.6.y backport.
Fixes: f53dd26462b8 ("pinctrl: remove pinctrl_gpio_direction_output()")
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=222122
Cc: stable@vger.kernel.org
Signed-off-by: pragnesh <pg.radadia@gmail.com>
---
Changes in v2:
- Add a Closes: tag for the Bugzilla report.
drivers/pinctrl/core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index f8d084f9f..66dbefcb5 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -23,6 +23,8 @@
#include <linux/seq_file.h>
#include <linux/slab.h>
+#include <linux/gpio/driver.h>
+
#include <linux/pinctrl/consumer.h>
#include <linux/pinctrl/devinfo.h>
#include <linux/pinctrl/machine.h>
--
2.43.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-12-05 5:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-05 5:06 [PATCH v2 6.6.y] pinctrl: core: include linux/gpio/driver.h pg.radadia
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.