[PATCH 2/2] pinctrl: at91: add FIXME about read back of struct gpio_chip::base
Ahmad Fatoum
a.fatoum at pengutronix.de
Wed May 7 10:28:02 PDT 2025
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 at pengutronix.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
More information about the linux-arm-kernel
mailing list