[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250507-gpio-chip-base-readback-v1-2-ade56e38480b@pengutronix.de>
Date: Wed, 07 May 2025 19:28:02 +0200
From: Ahmad Fatoum <a.fatoum@...gutronix.de>
To: Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>
Cc: Nicolas Ferre <nicolas.ferre@...rochip.com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Claudiu Beznea <claudiu.beznea@...on.dev>,
Ludovic Desroches <ludovic.desroches@...rochip.com>,
linux-gpio@...r.kernel.org, kernel@...gutronix.de,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
Ahmad Fatoum <a.fatoum@...gutronix.de>
Subject: [PATCH 2/2] pinctrl: at91: add FIXME about read back of struct
gpio_chip::base
drivers/gpio/gpiolib.c has this:
/*
* TODO: it should not be necessary to reflect the
* assigned base outside of the GPIO subsystem. Go over
* drivers and see if anyone makes use of this, else
* drop this and assign a poison instead.
*/
gc->base = base;
This would break the driver, because it assumes gpio_chip::base to be
the same static base that was written into it.
Point that out in a comment, until it's fixed.
Signed-off-by: Ahmad Fatoum <a.fatoum@...gutronix.de>
---
drivers/pinctrl/pinctrl-at91.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index 93ab277d9943cff3a0b771f3e997594cb144826c..b0e00f3793312de2288aa1b900793d9e2b6125d6 100644
--- a/drivers/pinctrl/pinctrl-at91.c
+++ b/drivers/pinctrl/pinctrl-at91.c
@@ -949,6 +949,11 @@ static int at91_gpio_request_enable(struct pinctrl_dev *pctldev,
dev_dbg(npct->dev, "enable pin %u as GPIO\n", offset);
+ /*
+ * The GPIO chip base is an internal detail that will
+ * eventually go away alongside sysfs and the global numberspace.
+ * FIXME: stop reading it back here
+ */
mask = 1 << (offset - chip->base);
dev_dbg(npct->dev, "enable pin %u as PIO%c%d 0x%x\n",
--
2.39.5
Powered by blists - more mailing lists