summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLéo DUBOIN <lduboin@freebox.fr>2024-04-25 15:58:02 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-09-08 07:56:41 +0200
commitca32ee853a1e1c6b8d15e9f9fab4af9bfea919a6 (patch)
treec9ca2ec328df814a91373adef974bdc41db1bcd7
parentf45f8af567b666493975af72d630d238eb58506f (diff)
pinctrl: core: reset gpio_device in loop in pinctrl_pins_show()
[ Upstream commit 9dfbcf2fc566c0be2de1c7685f29effd25696b75 ] We were not resetting the pointer to the associated gpio_device once we are done displaying a pin's information. This meant that once we reached the end of a gpio-range, if there were pins right after it that did not belong to any known range, they would be associated with the previous range's gpio device. This resulted in those pins appearing as <4294966783:old_gdev> instead of the expected <0:?> (due to gpio_num being -1). Signed-off-by: Léo DUBOIN <lduboin@freebox.fr> Link: https://lore.kernel.org/r/c40d0634abefa19e689ffd450e0f48a8d63c4fc4.1714049455.git.lduboin@freebox.fr Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/pinctrl/core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index 4438f3b4b5ef..60f866f1e6d7 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -1670,6 +1670,7 @@ static int pinctrl_pins_show(struct seq_file *s, void *what)
seq_printf(s, "pin %d (%s) ", pin, desc->name);
#ifdef CONFIG_GPIOLIB
+ gdev = NULL;
gpio_num = -1;
list_for_each_entry(range, &pctldev->gpio_ranges, node) {
if ((pin >= range->pin_base) &&