Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: pg.radadia@gmail.com
To: stable@vger.kernel.org
Cc: linux-gpio@vger.kernel.org, linus.walleij@linaro.org,
	brgl@bgdev.pl, pragnesh <pg.radadia@gmail.com>
Subject: [PATCH v2 6.6.y] pinctrl: core: include linux/gpio/driver.h
Date: Sat,  5 Dec 2026 10:36:34 +0530	[thread overview]
Message-ID: <20261205050634.87948-1-pg.radadia@gmail.com> (raw)

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


                 reply	other threads:[~2026-12-05  5:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261205050634.87948-1-pg.radadia@gmail.com \
    --to=pg.radadia@gmail.com \
    --cc=brgl@bgdev.pl \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox